Quantcast
Viewing all articles
Browse latest Browse all 8068

Using the DocumentViewer to share an image with text

Hi all! I'm developing a mobile application on Titanium SDK 3.2.3GA, targeting iOS 7.1 and testing on an iPhone 4S, hosted on OSX 10.9. My goal is to share an image with text on social media (including Instagram), e-mail, and texting. I'm currently using the DocumentViewer to share an image:

var docViewer = Ti.UI.iOS.createDocumentViewer({ "url": imageFilePath });
docViewer.UTI = "com.instagram.exclusivegram";
docViewer.show({ "view": anchor, "animated": true });
A few notes for testing: imageFilePath must be a .ig file to work with Instagram, and the variable anchor represents a view that the documentViewer needs to be anchored to.

This example works fine for sharing an image, but I really want to share text (as in a prepopulated message) as well. Earlier I was using the TiSocial.Framework module (https://github.com/viezel/TiSocial.Framework), which worked great for sharing an image with text but doesn't support Instagram. It looks like they were onto something in this post: https://developer.appcelerator.com/question/155950/adding-caption-for-instagram, but I haven't gotten it to work and it sounds like no one on the post did, either. Instagram supports passing in captions (http://instagram.com/developer/iphone-hooks/#) but a) I haven't found the equivalent in Titanium and b) I need text to be shared to all apps that can be opened by the DocumentViewer. Has anyone found a way to share text along with an image using the DocumentViewer?

Any assistance would be greatly appreciated. Thanks!


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>