Social popup event.action always returns cancelled (Android)

So pretty much lifted the code from here: https://coronalabs.com/blog/2015/04/21/tutorial-social-sharing-on-android/

This opens a panel with several icons on with the most relevant options I get are gmail, google +  and facebook.  If I click facebook nothing happens for a few seconds, then the dialog closes and I get “cancelled” coming in as the event.action.  Whats that all about?

If I click email, sure enough it launches gmail with all the correct data passed over in the message.  I send the email, gmail closes, not the keyboard though, and returns to the app (keyboard still open), then event.action comes in - “cancelled”.

google + returns “completed” though?!

So should I take this plugin seriously or is it a work in progress still?  I’m using the activity popup on iOS and thats pretty slick.

EDIT: Actually based on my recent discovery that google + returns completed I should rename the title of this topic to “Inconsistent event.action” :slight_smile:

EDIT: Google drive seems to work too.

What are you trying to post with Facebook?

Rob

Rob, this is the code:

I messed about with it today and if I remove the image item then facebook opens up and posts the message OK.  However it still returns this (same action returned with gmail) even though the action categorically completed:
 

03-31 09:47:41.185: I/Corona(9309): SHARING popup social cancelled

function sharingService:onShareAndroid() local isAvailable = native.canShowPopup( "social", "share" ) -- If it is possible to show the popup if isAvailable then local listener = {} local onShareCallback = self.callback function listener:popup( event ) -- event.name -- event.type -- event.action -- event.limitReached print("SHARING", event.name, event.type, event.action) if onShareCallback then onShareCallback(event.action) end end -- Show the popup native.showPopup( "social", { service = "share", message = gameConfig.shareParams.message, listener = listener, image = { { filename = "screen\_shot.png", baseDir = system.TemporaryDirectory, }, }, url = { gameConfig.shareParams.url, } }) else if self.callback then self.callback() end end end

There is a Facebook limitation that you cannot provide an image/link at the same time you provide a message. You must pick one and post it. I’ve  heard link+image works. But when posting those items, you cannot have a pre-filled out text. This is a Facebook requirement.

Rob

Well thats manageable.  What is not is the action always being cancelled regardless of what happens.  Is that a bug with the plugin?  What is the best way to solve the issue with it?  

The iOS activity plugin works perfectly but need an equally stable equivalent for Android!

Try it following Facebook’s rules and see if you’re still getting a cancelled. If you’re passing a message and image/link, it’s logical for it to return cancelled. If it’s posting, then perhaps that’s the bug.

Rob

What about gmail?  Thats also the same

That may be an issue. Can I see that code?

Its the same code, its another option in the sharing panel that is displayed.

Go ahead and file a bug report then.

Make sure to have a main.lua that demonstrates the problem, config.lua and build.settings and any assets it needs to run (images, etc.). Put it in a folder and compress it to make a .zip file. Use the Report a Bug link at the top of this page. You will get an email with a CaseID in the subject. Please post that number back here as a reference.

Thanks

Rob

OK will do.

Case 45532

Just so I know, how long do these bug reports take before they are addressed/updated?

There are too many criteria that depend on when they get looked at. Bugs get a priority and are worked on in that order and depending on engineering availability. In this specific case, its been assigned to an engineer to look at.

Rob

What are you trying to post with Facebook?

Rob

Rob, this is the code:

I messed about with it today and if I remove the image item then facebook opens up and posts the message OK.  However it still returns this (same action returned with gmail) even though the action categorically completed:
 

03-31 09:47:41.185: I/Corona(9309): SHARING popup social cancelled

function sharingService:onShareAndroid() local isAvailable = native.canShowPopup( "social", "share" ) -- If it is possible to show the popup if isAvailable then local listener = {} local onShareCallback = self.callback function listener:popup( event ) -- event.name -- event.type -- event.action -- event.limitReached print("SHARING", event.name, event.type, event.action) if onShareCallback then onShareCallback(event.action) end end -- Show the popup native.showPopup( "social", { service = "share", message = gameConfig.shareParams.message, listener = listener, image = { { filename = "screen\_shot.png", baseDir = system.TemporaryDirectory, }, }, url = { gameConfig.shareParams.url, } }) else if self.callback then self.callback() end end end

There is a Facebook limitation that you cannot provide an image/link at the same time you provide a message. You must pick one and post it. I’ve  heard link+image works. But when posting those items, you cannot have a pre-filled out text. This is a Facebook requirement.

Rob

Well thats manageable.  What is not is the action always being cancelled regardless of what happens.  Is that a bug with the plugin?  What is the best way to solve the issue with it?  

The iOS activity plugin works perfectly but need an equally stable equivalent for Android!

Try it following Facebook’s rules and see if you’re still getting a cancelled. If you’re passing a message and image/link, it’s logical for it to return cancelled. If it’s posting, then perhaps that’s the bug.

Rob

What about gmail?  Thats also the same