Skip to content

Instantly share code, notes, and snippets.

@marchbold
Last active January 23, 2020 22:47
Show Gist options
  • Save marchbold/a4c82c56525cbd633e3b to your computer and use it in GitHub Desktop.
Save marchbold/a4c82c56525cbd633e3b to your computer and use it in GitHub Desktop.
Using the Share ANE to share an image with other applications
[Embed("assets/image.png")]
public var TestImage:Class;
...
if (Share.isSupported)
{
Share.service.addEventListener( ShareEvent.COMPLETE, share_shareHandler );
Share.service.addEventListener( ShareEvent.CANCELLED, share_shareHandler );
Share.service.addEventListener( ShareEvent.FAILED, share_shareHandler );
// Here we have embedded an image "assets/image.png" in our application (above)
var image:Bitmap = new TestImage() as Bitmap;
Share.service.share( "some text", image.bitmapData, "http://airnativeextensions.com" );
}
...
private function share_shareHandler( event:ShareEvent ):void
{
trace( event.type + "::" + event.activityType + "::" + event.error );
}
// com.distriqt.Share
@marchbold
Copy link
Author

@polyGeek
Copy link

polyGeek commented Mar 2, 2019

When using Share.service.share() is there any information about which application/platform the share was sent to? All I can find is a "share:complete" or "share:fail" info.

If not, is there another function I can use in the Share ANE that would let me know which platform was shared to?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment