At Corona Labs, we strive to provide as much cross-platform functionality as possible. Now Corona apps built for Android can utilize the “Social” plugin. Everything that you need to know from a code standpoint is detailed in the original tutorial: Introducing the “Social” Plugin (iOS).

That being said, there are a few differences on Android…

There is Only One “Service”

With iOS, you have to determine if native.showPopup() will show a Facebook dialog, a Twitter dialog, or a SinaWeibo dialog. On Android, it shows the Android “sharing panel” which includes buttons for everything that supports sharing. As you install and remove apps from your Android device, the options on this screen will change. As such, in your code, you don’t have to provide the “service” option in the options table. Don’t be concerned if you’re using this key in your existing code for iOS — it will simply be ignored on Android.

social

Facebook is not Available in this Plugin

There is a known bug between Facebook and Android that prevents the Android sharing intent from posting to Facebook. As such, Facebook recommends that developers use the regular Facebook methods to post to Facebook.

Finally, please note that this plugin is currently in the beta stage. If you locate any bugs, please report them.

    • In addition to what David said. The reason this particular plugin doesn’t support Facebook has a bug using the Android sharing intent, which this plugin uses. The timeline for fixing that is in Facebook’s court. As David pointed out, we have native Facebook support for building your own Facebook sharing. Please look in the SampleApps that come with Corona in the Networking folder. There are a couple of different Facebook apps you can look at to see the coded needed to implement Facebook outside of this plugin.

  1. maybe there’s a bug between android and facebook?? coz i managed to login using the “facebook” and “scrumptious” corona examples but i got the folowing error when im in, “the page your requested cannot be displayed right now. it may be temporarily unavailable, the link you clicked maybe broken or expired, or you may not have permission to view this page.”

  2. It’s a great feature and I tried on my Android device, but I see this popup

    “Unable to find application to form this action”

    I think I at least have gmail configured, why would I see this?

  3. Hi, for some reason android share via; has stopped working. Now I’m just getting this window.

    Share via:
    No apps can perform this action.

  4. I am also getting “No apps can perform this action.” on android with facebook and twitter. Works great on ios. 2013.2087.

    local function onFacebook(event)
    util.print_r(event)
    native.showAlert( “Facebook”, “Message “.. event.action, { “Ok” })
    end
    local options = {
    service = “facebook”,
    message = “Join me”,
    listener = onFacebook
    }
    native.showPopup( “social”, options )

  5. I have a problem for use social plugin for Twitter! SMS ok, e-mail ok… but use for tweets is a marathon! I search in documentation and forum but not have a solution.
    I try, but the message is:

    “The social popup is currently not supported on this plaftorm, please build for an iOS device.”

    The version of my simulator is 2013.2100 (2013.12.7)

  6. I have a problem for use social plugin for Twitter! When i am trying to share image via twitter using social plugin. i got error image could not be loaded.

    i am pro subscriber of Corona.

    i am using Build: 2014.2170

    Thanks.

  7. Is there a way to achieve something similar to this on iOS? Because I notice that iOS has a similar share system (one button share to Message, Mail, Twitter and Facebook, etc.), but from the article above, it’s stated that “With iOS, you have to determine if native.showPopup() will show a Facebook dialog, a Twitter dialog, or a SinaWeibo dialog.”.

    • Rob Miracle says:

      We did a tutorial on a sliding panel this week. You can use it, add in a background and the icons for the services you want to support to the group returned by the panel.

  8. In version 2214 , windows, android 4.3 with twitter configured and network connection the line

    local isTwitterAvailable = native.canShowPopup( “social”, “twitter” )

    returns false.

    I´m i missing something?

    thx!

  9. As i saw other apps on android can share via Facebook without an login! So what you are saing is that we will never have the possibility to share content on Facebook without implamenting the facebook sdk?

    • My understanding from Engineering is that this is related to a bug between Google and Facebook that’s still unresolved. Perhaps once this is resolved, we can try to address it.

  10. Sorry to rehash this facebook support issue, but the “bug” cited in the API documentation has been closed since August 2012 by Facebook, citing design intent.

    This issue is going to be closed by design because our API does not support pre-filling the message for users as seen in our Policy Documentation here (https://developers.facebook.com/docs/guides/policy/application_integration_points/) under Platform Policy IV.2.
    Thanks,
    Jesse
    August 13, 2012 at 3:24am · Status changed to By Design

    As @Teodor mentioned, other android apps use the sharing menu with Facebook, so it doesn’t seem to be a situation that can’t be dealt with. If I’m understanding the comments on the facebook developer thread noted above correctly, it seems that maybe FB support would be available if the app didn’t attempt to send a message content string to the sharing menu API, which the corona social plugin must be doing (it passes the options.message string to twitter, email, etc.)

    It seems to me that if the corona app does not specify options.message, the social plugin should be see that and not attempt to send EXTRA_SUBJECT and/or EXTRA_TEXT to the FB API, thus allowing FB to work from the social plugin on Android.

  11. We find it unacceptable when all the other 99.99% apps are able to post to facebook without performing login. Just imagine, you want to share something, but the app suddenly request you to login, asking to access your basic info, asking for your permission for posting, etc.

    Please tell Engineering to fix this.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>