Supporting iOS modal share action sheet (AirDrop, Print, Add to Home Screen, Add Bookmark, Add to Reading List, etc.)

Hi Rob

I took the code from https://github.com/coronalabs/plugins-sample-native-popup-activity

declared local button on top of the code and replaced

        native.showPopup( popupName,
        {
            items = itemsToShare,
            – excludedActivities = { “UIActivityTypeCopyToPasteboard”, },
            listener = listener,
        })

with

        native.showPopup( popupName,

        {
            items = itemsToShare,
            – excludedActivities = { “UIActivityTypeCopyToPasteboard”, },
            listener = listener,
            origin = button.contentBounds,
            permittedArrowDirections={ “up”, “down” }            
        })

I build with the daily build 2015.2603 - put it on device ( iPad Air with iOS 7.1.2 )

and the popup shows up for a blink of a second and then it crashes. In xcode console window:

Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘-[UIPopoverController dealloc] reached while popover is still visible.’

Is iOS 7.1.2 the problem ?

Thanks

Peter

Hi Rob

I did an Upgrade to iOS 8.2 and now all works well.

Confusing.

Regards

Peter

I did a native plugin for the modal share action with image, text and url (for Airdrop, MMS, Mail, Air print, Twitter, Facebook etc.) + Instagram sharing as a custom activity.

You can find it here: https://github.com/jcbnlsn/CoronaSharePlugin

This is only for Enterprise subscribers.

@CoronaLabs feel free to put it on your plugin server :wink:

Folks: There are now two more threads in the last day or so asking about sharing:

http://forums.coronalabs.com/topic/54267-here-is-how-to-share-a-picture-image-with-instagram-with-corona-sdk-without-enterprise/

"I think instagram/apple decided that the only way to share to instagram is through the native UIDocumentsInteractionController.

Corona doesn’t have that implementet but you should vote it up in the feature requests."

Brent: It’s been two weeks since you said you were consolidating and combining feedback requests, and we’ve known for a while that proper sharing is developers’ most-requested feature. Can you give us any insight into a timeframe, either through your own method or through <ojnab>'s plugin if possible?

Hi all,

We understand and have listened to your requests. We will have our own plugin for this available within the next few days, available to Pro and above. It will mimic the UIActivityController in iOS and should offer whatever Apple offers in that regard.

Best regards,

Brent

Brent: This is excellent news! Thanks very much for listening to us. You’ve made my week!

@Brent 

That sure is a nice decision! Thanks.

Execellent news! How can we share to instagram on android?

<spacewolf>: You may want to check out this discussion of Android sharing, though it’s focused on Corona’s lack of support for Facebook sharing via the social plugin:

http://forums.coronalabs.com/topic/52755-can-corona-enable-limited-facebook-sharing-on-android-via-nativeshowpopup/

So the social plugin will allow sharing to instagram if you specify an image in the api call?

Yes, I tested it with my Corona-built app a moment ago and it works. More precisely, it launches Instagram from within a Corona Android app – but I’m not logged into Instagram on my Nexus test device so I don’t know if it’s actually crippled like Facebook.

You may need a pro subscription to use this, not sure.

Great news! Been looking forward to this feature for a long time. I can finally ditch my twitter and Facebook native.showPopup() work around.

Hi all,

This plugin should be ready for you to use. Remember, this is for iOS only. Here’s the documentation:

http://docs.coronalabs.com/daily/plugin/CoronaProvider_native_popup_activity/index.html

Take care,

Brent

Brent! Thanks again! I built a Corona app yesterday (using daily build 2015.2553) and the plugin worked perfectly on an iOS device.

@Brent

Just tested the activity plugin. Works fine on iphone but crashes on ipad.

The reason is that on ipad you need to present the activity view in a popover.

This also means you need to send parameters from corona telling where the popover should be presented. You already do this kind of thing in the implementation of media.selectPhoto:

origin = button.contentBounds, permittedArrowDirections = { "right" },

Thanks

also it would be nice to be able to set the subject ( although I think this is only used in emails )

[activityController setValue:@"Some email subject" forKey:@"subject"];

So how do I do the opposite of this, and let someone send data into my Corona app? How do I register my Corona app to show up in someone else’s share sheet in iOS?

Our plugin only supports what iOS does out of the box. While the controller we are using will support other apps, you would need to use Corona Enterprise and build your own version that handles the specifics of your app.

Rob

Just curious - what is the deciding factor on new features becoming Pro and Above only?

There are many factors that go into the decision.  Some are technical, like it needs a feature that’s only available to pro subscribers, or perhaps we made a change that’s currently only available in daily builds that the plugin needs, so it’s only available to pro subscribers until the next build (AdMob V2 is a great example of this).  Other times it’s a business decision.

Rob