I have done the below code to post an Image and a Text on Instagram
let fileURL = NSURL(fileURLWithPath: writePath) self.documentController = UIDocumentInteractionController(URL: fileURL) self.documentController.delegate = self self.documentController.UTI = "com.instagram.exclusivegram"//"com.instagram.photo" self.documentController.annotation = NSDictionary(object: strTitle as String, forKey: "InstagramCaption") self.documentController.presentOpenInMenuFromRect(self.view.frame, inView: self.view, animated: true)
It’s working fine in iOS 8.3 but the Caption is missing in iOS 9.
Why is that and how can I fix it?
I had the same problem, and I have found out that it has been removed by Instagram on earlier August, 2015.
Just found out that Instagram removed this function in its new version
Not really sure since I don’t have a sample project to try, but is there a particular reason not to use Swift dictionary instead of NSDictionary?
self.documentController.annotation = ["InstagramCaption": strTitle]
It’d be nice if you could provide a sample project. Also, keep in mind that Swift 2 is still in beta, so is iOS 9. I found a few bug in OS X El Capitan with Swift 2 recently that code works on Yosemite does not work the as expected.
If you are us iOS Hooks then it will stop accepting captions passed by third party apps. Existing mobile apps that utilize pre-filled captions will continue to be able to use this flow to share media through the Instagram apps, but now Instagram will ignore the caption text. To create a caption for a photo or video shared by a third party app, users will have to enter a caption manually, the same way they already do when sharing content using the Instagram native apps.