ShareWithInstagram is a native extension to share images to Instagram on iOS. If an application creates photos and users should be able to share these photos using Instagram, the extension can be used to access the Document Interaction API to open the photo in Instagram’s sharing flow. The extension has two entry points, a property to check the installation of Instagram and a method to open the image with Instagram app for share (using a ByteArray
and String
caption).
The image must first be saved in PNG or JPEG (preferred) format and use the filename extension “.ig”. Alternatively it’s possible to show only Instagram in the application list (instead of Instagram plus any other public/jpeg-conforming apps) by specifying the extension class igo, which is of type com.instagram.exclusivegram. When triggered, Instagram will immediately present the user with the filter screen. The image is preloaded and sized appropriately for Instagram. Other than using the appropriate image format, described above, the only requirement is that the image is at least 612px tall and/or wide. For best results, Instagram prefers opening a JPEG that is 612px by 612px square.
Sample
if(com.azer.ios.Share.getInstance().isInstagramInstalled()) { var byte:ByteArray = new ByteArray(); byte = YourBitmapData.encode(YourBitmapData.rect, new JPEGEncoderOptions(90), byte); com.azer.ios.Share.getInstance().addEventListener(StatusEvent.STATUS, onStatusHandler); com.azer.ios.Share.getInstance().postToInstagram(byte, "Your Caption Here"); } function onStatusHandler(event:StatusEvent):void{ // you call here: // com.azer.ios.Share.getInstance().dispose(); }
Via: FlashDaily.net