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

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

Any news about when local images will be allowed to be upload to facebook?

No.  Everyone asked for link support and we were told and all research said you can only do links, so that’s what we added support for.  Since it seems that images should also work, we now have to get it back in the queue.

Rob

up the thread for sharing image and url and text for facebook on android.

I’ll second that!!!

>Everyone asked for link support…

Rob: You’re right that we asked for link support. But we’ve been asking for over half a year for image sharing support as well. I started this thread in November 2014 and posted on November 18 that: “Facebook sharing on Android is broken because URLs and images can’t be shared.”

I posted on November 25 asking for Facebook sharing for “a URL or image.”

I posted on February 5 asking for an update on “allowing Facebook sharing of URLs and images.”

I posted a second time on February 5 that “We’re asking to be able to use the standard Android share menu with Facebook for URLs and images.” (emphasis in the original)

Perhaps I should have put all these requests in bold from the beginning. :slight_smile:

<Nob Studio> and <anil8>: I just checked and Corona-built apps do currently allow text to be selected from a webview then “shared” via Facebook on Android via the system sharing panel. (I placed “shared” in quotes because the selected text doesn’t appear in the Facebook app, but Gmail acts the same way, so presumably FB is being promiscuous in what it accepts.)

But are you aware of Android apps that allow text to be programmatically selected (not via user textfield selection) and shared with Facebook as well? I just want to make sure that we’re not asking Corona to do something impossible, especially because this Facebook policy exists: "Our API does not support pre-filling the message for users” https://developers.facebook.com/bugs/332619626816423/

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.

I just tried the social popup in daily build 2015.2647 and when the user clicks on the button he sees:

  • No facebook button
  • Double Twitter button

What do you need to do to show facebook on social popup?

Can you post a screen shot of what’s going on?  Some code on how you’re calling the plugin would be  helpful too.

Rob

Hello Rob,

Thank you for the fast answer, here we go:

build.settings plugins = { ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs" }, }, Game.lua function postFacebook( ) local options = { service = "facebook", message = "I just made "..oScore.." Points in Monsters Fall!", listener = socialEventListener, image = { { filename = "Icon-xhdpi.png", baseDir = system.ResourceDirectory }, }, url = "https://play.google.com/store/apps/details?id=com.loopends.monstersfall" } native.showPopup( "social", options ) end function goFacebook:touch(event) if event.phase == "ended" then postFacebook() end end goFacebook:addEventListener("touch",goFacebook)

Screenshots: (Link to high res: http://postimg.org/gallery/3ikpk0vak/))

Screenshot_2015_06_04_01_13_26.png Screenshot_2015_06_04_01_13_33.png

As you can see im getting double twitter icon, and none facebook.

Thank you very much

Make sure message is blank:

message = “”

Not even a space…

Rob

Hello Rob,

Still getting the same error. Going to try in another device and i tell you soon.

Joe