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

As everyone who knows and loves Facebook, Android, and the native.showPopup() social plugin knows, Corona has long taken the position that: “On Android, this plugin does not support Facebook due to a bug.” http://docs.coronalabs.com/plugin/CoronaProvider_native_popup_social/showPopup.html

That position is because Facebook hates-hates-hates when apps pre-fill out text, which native.showPopup() allows. Facebook’s official position is: “Our API does not support pre-filling the message for users” https://developers.facebook.com/bugs/332619626816423/

But why not enable native.showPopup() for Facebook when *no* text is being filled out, such as when only a URL or image is being shared?

After some experimenting this evening, I’ve figured out how to share URLs via the Facebook app on Android using daily build 2014.2472 (and without having to use everyone’s favorite facebook.* library). But then it’s an awful UI: Button A for “share on Twitter, email, SMS, Bluetooth, Instagram, Google+, Hangouts, etc. via a nice native popup” and Button B for “share on Facebook.”

Can y’all fix this so URLs can be shared properly on Facebook on Android? The same technique would presumably work for images too. An easy way to do this (I’m speculating here) might be to simply ignore the “message” part of the table that’s passed to native.showPopup.

Thanks!

also see this thread:

http://forums.coronalabs.com/topic/51389-nativeshowpopupmail-way-to-force-equiv-of-showactivitywithchooser/

you can try it for yourself today, it already works with a bit of manual intervention:

first, clear out any default app association you have for email (this will cause the “just-once-always” share dialog to appear so that you can choose the app yourself).  then post an email, selecting twitter or facebook or g+ (or just anything else you have installed) and it “just works”.  including facebook, including picture attachments.  essentially it works just like every other android app you’ve ever used built with some other framework - this is how nearly everyone (except Corona) does one-button sharing on android.

you still want to take care to not auto-populate fb text or you’d eventually get banned for ToS, but it is a one-button solution. caveat is that it only works for those apps actually installed (that is, if no local twitter/facebook/etc app then can’t share via them, since not done via a native library in corona)

i posted it as a feature request, but after posting it, i realized that this simple feature would compete directly with the social plugin (as a paid pro+ -level feature) so it’s perhaps unlikely they’d just give it to us.

Dave: Interesting! Thanks for the tip. But if I understand you properly, to get this working, I would need to instruct my users on older versions of Android to go to Android Settings, then Manage Apps (or, if on L, just “Apps”), then choose whatever email app they use, then clear the defaults. And they’d have to do this every time they change the app association for email, which might be multiple times a day based on their workflow.

That’s an interesting one-time workaround for testing but not a solution – not your fault! – that is suitable for a production app. Other Android apps like Flipboard can share URLs without pre-filled text via the Facebook app, and Corona-built apps should be able to as well.

Rob? Anyone?

right/exactly, only as “proof of concept”, not suitable as is for production, thus the feature request.

“one button sharing” is super simple on android IF you do it the android way.  fe, fire up Hill Climb Racing (or just about any other AA title with a one-button share) and you’ll get the chooser, cuz this is how they’re doing it.

(it’s only a handful of code to do either, pre-registered provider or via chooser, with only a single change to create a chooser, just ask google:  http://developer.android.com/training/sharing/send.html))

plus, if you do it this way, via choosing a delegated app, you skip all the silly api login nonsense.  assuming user has fb app setup and linked to their account, it just goes right to the posting form, app handles login.  same with twitter/etc.  truly this is how you’re supposed to do it.

only if you needed actual *integration* (to whatever low-level api features, OR if must be able to do simple sharing even if app not installed) would you instead muck around with the native fb api.  for simple sharing none of that is actually necessary if you’re content to let them share only via installed apps, and let’s you share with ANY social network the user happens to have installed that has registered itself as a suitable provider for the share action intent.

oh, wait, but that sounds like the $ocial plugin, dang, so my guess is we won’t be getting this as a one-liner feature, follow?   :wink:

Ah, understood. Yep, this is simple URL or image sharing, no pre-filled text.

If Corona wants to try to get their customers to pay more by allowing proper Facebook sharing via the social plugin only with a pro subscription, that’s their business. They’re not a charity, tiered price discrimination works, and they have to keep the lights on in their Palo Alto offices somehow. (Note I’ve paid for a pro subscription.)

My complaint is that *even with a paid pro subscription*, Facebook sharing on Android is broken because URLs and images can’t be shared. Looking forward to Rob or someone else from Corona saying this will be fixed in the next daily build. :slight_smile:

btw, i’m not against them charging for it either, but to your point:  even the paid social plugin doesn’t actually work.   i myself gave up on social (and a pro subscription, since there’s little else there that entices me personally) and wondered if they could instead fix it via showPopup(“email”) by just forcing a chooser to the fb app. (since that DOES work)

the point of my experiment was “it doesn’t have to be this hard”.  i don’t know what the social plugin does, or why it fails, but corona is perfectly capable of simple sharing via the facebook app.  (it’s just too cumbersome to actually use as is)

hope that helps lend you support that:  there shouldn’t be any technical reason for not making the social plugin work w fb

Looks like it’s been a week without a response. Is Rob on an early holiday vacation? :slight_smile:

I’m waiting on a response from Engineering.  

Rob

Thanks, Rob! Looking forward to it. 

Facebook loves for apps to offer sharing features, as long as there is no filled-in text (and there isn’t if all developers are sending is a URL or image).

On a separate but related note and it would be lovely to have Corona expose the standard iOS modal share action sheet with the native.showPopup() plugin. That’s the action sheet with AirDrop, Facebook, Tumblr, Evernote, Add to Home Screen, Add Bookmark, Add to Reading List, etc.

The good folks at StackOverflow call it a “trivial” 10 lines of code in Objective C:

“The UIActivityViewController stated in the other answer makes this trivial. All you have to do is specify the text/image/URL that you want to share and present the activity view controller modally and iOS will automatically display all applicable sharing services.” http://stackoverflow.com/questions/13498459/how-to-display-the-default-ios-6-share-action-sheet-with-available-share-options

May I push my luck and ask you to pass that along to Engineering as well? :slight_smile:

Happy pre-holiday, folks!

Rob: It’s been a month since my original question (you said you were waiting on a response from Engineering), so I thought I’d ask again. Do you have a timeline on correctly implementing Facebook sharing via native.showPopUp(), perhaps? Thanks!

also see this thread:

http://forums.coronalabs.com/topic/51389-nativeshowpopupmail-way-to-force-equiv-of-showactivitywithchooser/

you can try it for yourself today, it already works with a bit of manual intervention:

first, clear out any default app association you have for email (this will cause the “just-once-always” share dialog to appear so that you can choose the app yourself).  then post an email, selecting twitter or facebook or g+ (or just anything else you have installed) and it “just works”.  including facebook, including picture attachments.  essentially it works just like every other android app you’ve ever used built with some other framework - this is how nearly everyone (except Corona) does one-button sharing on android.

you still want to take care to not auto-populate fb text or you’d eventually get banned for ToS, but it is a one-button solution. caveat is that it only works for those apps actually installed (that is, if no local twitter/facebook/etc app then can’t share via them, since not done via a native library in corona)

i posted it as a feature request, but after posting it, i realized that this simple feature would compete directly with the social plugin (as a paid pro+ -level feature) so it’s perhaps unlikely they’d just give it to us.

Dave: Interesting! Thanks for the tip. But if I understand you properly, to get this working, I would need to instruct my users on older versions of Android to go to Android Settings, then Manage Apps (or, if on L, just “Apps”), then choose whatever email app they use, then clear the defaults. And they’d have to do this every time they change the app association for email, which might be multiple times a day based on their workflow.

That’s an interesting one-time workaround for testing but not a solution – not your fault! – that is suitable for a production app. Other Android apps like Flipboard can share URLs without pre-filled text via the Facebook app, and Corona-built apps should be able to as well.

Rob? Anyone?

right/exactly, only as “proof of concept”, not suitable as is for production, thus the feature request.

“one button sharing” is super simple on android IF you do it the android way.  fe, fire up Hill Climb Racing (or just about any other AA title with a one-button share) and you’ll get the chooser, cuz this is how they’re doing it.

(it’s only a handful of code to do either, pre-registered provider or via chooser, with only a single change to create a chooser, just ask google:  http://developer.android.com/training/sharing/send.html))

plus, if you do it this way, via choosing a delegated app, you skip all the silly api login nonsense.  assuming user has fb app setup and linked to their account, it just goes right to the posting form, app handles login.  same with twitter/etc.  truly this is how you’re supposed to do it.

only if you needed actual *integration* (to whatever low-level api features, OR if must be able to do simple sharing even if app not installed) would you instead muck around with the native fb api.  for simple sharing none of that is actually necessary if you’re content to let them share only via installed apps, and let’s you share with ANY social network the user happens to have installed that has registered itself as a suitable provider for the share action intent.

oh, wait, but that sounds like the $ocial plugin, dang, so my guess is we won’t be getting this as a one-liner feature, follow?   :wink:

Ah, understood. Yep, this is simple URL or image sharing, no pre-filled text.

If Corona wants to try to get their customers to pay more by allowing proper Facebook sharing via the social plugin only with a pro subscription, that’s their business. They’re not a charity, tiered price discrimination works, and they have to keep the lights on in their Palo Alto offices somehow. (Note I’ve paid for a pro subscription.)

My complaint is that *even with a paid pro subscription*, Facebook sharing on Android is broken because URLs and images can’t be shared. Looking forward to Rob or someone else from Corona saying this will be fixed in the next daily build. :slight_smile:

btw, i’m not against them charging for it either, but to your point:  even the paid social plugin doesn’t actually work.   i myself gave up on social (and a pro subscription, since there’s little else there that entices me personally) and wondered if they could instead fix it via showPopup(“email”) by just forcing a chooser to the fb app. (since that DOES work)

the point of my experiment was “it doesn’t have to be this hard”.  i don’t know what the social plugin does, or why it fails, but corona is perfectly capable of simple sharing via the facebook app.  (it’s just too cumbersome to actually use as is)

hope that helps lend you support that:  there shouldn’t be any technical reason for not making the social plugin work w fb

I need too. News Rob?

<phpedinei>: The good folks at Corona have, sadly, been repeatedly reluctant to fix these sharing problems.

In the Android Facebook sharing situation, <davebollinger> noted in November it would be only a handful of code. But there’s been no response in this thread since then.

In the iOS sharing situation, there are 10 lines of ObjC code that need to be added – to support a feature that is the most-requested on Corona’s official request forum. But a few days ago Walter and Brent both pointedly declined to say it would be added: http://forums.coronalabs.com/topic/53371-supporting-ios-modal-share-action-sheet-airdrop-print-add-to-home-screen-add-bookmark-add-to-reading-list-etc/

Given this reluctance over multiple months to add two trivial sharing features, my guess is Corona management views their absence as either unimportant or a way to convince developers to pay considerably more for Enterprise. That’s their right, of course, but it would be nice if developers were told so forthrightly.

We published a CoronaCards blog showing how to do this with Swift  a  couple of weeks ago.  This one feature doesn’t have a lot of votes on the feedback site and while it’s trivial to implement in native (Heck I was able to do it with Swift and native isn’t my area of expertise), it still needs to get scheduled into the engineer’s work load.  But with the work done in another thread, where many feature requests would be solved with this one solution, I think we have gotten this on the radar.  I can’t promise when, because we have a lot on our plate right now, but it’s at least there.

Now for it being just 10 lines of code.  Perhaps for a pure implementation that might be true, but for use it’s going to be quite a bit more work.  The only logical place for this is in native.showPopup(“social”) with a service of “share” to match the same thing on Android.  However, the social plugin is built around a completely different way of dealing with social services (albeit an iOS 6 way).  That code cannot just have this code easily slapped in and have it work.  It would be a very ugly hack to do so.  Its quite doable, but it’s not the low hanging fruit that people assume this will be.

Of course, more and more votes at the feedback site (http://feedback.coronalabs.com ) will help drive home the need for this. 

Rob

Looks like it’s been a week without a response. Is Rob on an early holiday vacation? :slight_smile:

I’m waiting on a response from Engineering.  

Rob