Can Corona enable (limited) Facebook sharing on Android via native.showPopup()?

Have you tried it recently? I’ve seen Engineering chatter that they had made changes around this plugin, but I don’t know if they’ve pushed the changes or not.  If it’s not working, hopefully it will be soon.

Rob

Rob: I have tested it and Android Facebook sharing now works properly!

More precisely, a Corona SDK-built app can now hand off text and a URL to the Android system sharing mechanism and Facebook will correctly appear as an option. (Twitter is still listed twice, once for tweets and the second for DMs, but that’s not as important.)

Thank you for fixing this. I am about to distribute the final beta of my app this afternoon and am very happy to tell my previously cranky users that Now It Just Works.

Hi Rob,

Thanks for pushing this fix through - we all appreciate the hard work you have put in to this.

Could you please confirm which Build/Version is required for the new functionality. Will it work in the current Public Build or will I need to download the latest Daily Build?

I am presently using 2015.2625 (2015.4.23).

Thanks

Anil

@Team

Is it possible to avoid the social media selection menu and go directly to facebook on Android?

If not, is there any way to eliminate the given choices in the list ?

<enil8>: At the risk of responding on Rob’s behalf, any recent version of Corona should work because it uses a plugin. I’m using 2015.2638 and it’s fine.

<Magenda>: I’m not aware of any way to do what you describe using the social plugin. Even if Android allows eliminating certain choices, which I don’t know, Corona does not expose it in their API.

@Magenda, you can use the Facebook plugin to accomplish something like what you’re describing. It’s fairly involved, but the best place to start is below:

https://docs.coronalabs.com/guide/social/setupFacebook/index.html

Yes, this is a plugin, any reasonably modern version of Corona SDK should see these Social Plugin changes without getting a new Corona SDK. 

If you wish to bypass the Operating System’s dialogs, use the Facebook  plugin an create your own.

Rob

@Team

Thanks for the replies!

The Facebook pluging has its own drawbacks because of the the non-prefilled messages policy of FB.

Practically, I cannot find a way to post a local photo giving the user the choice to write something before the post. You can only do this as a “me/feed” not as “me/photos”. But with a feed post you cannot have a local photo, just a server uploaded photo.

With “me/photos”, you can’t even have a url besides your local photo. Either you post the photo or the url. Not both of them can be posted together.

With the social plugin you can post a local photo. The user can also add a message to the photo post.

However, I cannot see the url to be properly posted. And the social list is a drawback…

Any ideas for local photo + url / message + no list ?

Photo + URL should work with the social plugin.

Rob

As an add-on to this. I’m still seeing odd behavior on Android when sharing on some devices/configurations.  

I have a user currently who can see the native share sheet popup in other apps, including Google Play. (I asked for a screenshot to be sure; granted, Google could be doing something custom and just making it look native, but as far as I can tell, it’s the native share sheet.)

However, in my app, when she tries to share a product, she gets an empty list.  

"Share via: No apps can perform this action."  

She just recently updated her Droid Turbo to Lollipop. She has Facebook and Instagram installed. Yet, nothing shows up to share to. I have a Nexus 6 (with Lollipop) for testing, and everything works fine.

local shareImage = {baseDir = system.CachesDirectory, filename = imageFilename} ... local options = {} options.image = { shareImage } options.message = shareText options.url = productWebLink &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; native.showPopup( "social", options )

Nothing too crazy there that I can see.

Has anyone else experienced this?  I’m on Build 2015.2687.

Is this implemented now? Because I have to choose between image or url (but not both) in latest stable.

As far as I know we rolled out changes a few months ago that lets you specify both. If the resulting dialog box from Android doesn’t handle it, then that’s on Google.

Rob

(Just to clarify, not to repeat: In 2015.2646, if you specify an image, all is well. If you specify a url, all is well. If you specify both, the url is ignored.)

Note also that if canShowPopup returns false despite the app being installed, or if the app is installed but doesn’t appear in the Android share menu, check account settings for the app. Phones aren’t basically never rebooted, and the user could ride on just the first-time login to the app for weeks, basically. And that won’t store credentials in the app so that it can grant sharing. This was the case with Facebook on iOS. There’s nothing you can do about it, in the end I gave up and showed an informative error message reflecting this.