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.


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)
    native.showAlert( “Facebook”, “Message “.. event.action, { “Ok” })
    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


  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?


  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 ( under Platform Policy IV.2.
    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.

    • // this is the snippet that makes me able to share to facebook. You are welcome.

      package net.posttofb.test;

      import android.content.Context;
      import android.content.Intent;
      import android.os.Environment;

      public class Show implements com.naef.jnlua.NamedJavaFunction {
      * Gets the name of the Lua function as it would appear in the Lua script.
      * @return Returns the name of the custom Lua function.
      public String getName() {
      return “show”;

      * This method is called when the Lua function is called.
      * Warning! This method is not called on the main UI thread.
      * @param luaState Reference to the Lua state.
      * Needed to retrieve the Lua function’s parameters and to return
      * values back to Lua.
      * @return Returns the number of values to be returned by the Lua function.
      public int invoke(com.naef.jnlua.LuaState luaState) {
      com.ansca.corona.CoronaActivity activity = com.ansca.corona.CoronaEnvironment.getCoronaActivity();
      if (activity == null) {
      return 1;

      String message = “”;
      String fileName = “”;
      String subject = “”;

      int luaTableStackIndex = 1;
      luaState.checkType(luaTableStackIndex, com.naef.jnlua.LuaType.TABLE);

      for(luaState.pushNil();; luaState.pop(1)){
      String keyName = null;
      com.naef.jnlua.LuaType luaType = luaState.type(-2);
      case STRING:
      keyName = luaState.toString(-2);
      case NUMBER:
      keyName = Integer.toString(luaState.toInteger(-2));

      if (keyName == null){

      String valueString = null;
      luaType = luaState.type(-1);
      case STRING:
      valueString = luaState.toString(-1);
      case BOOLEAN:
      valueString = Boolean.toString(luaState.toBoolean(-1));
      case NUMBER:
      valueString = Double.toString(luaState.toNumber(-1));
      valueString = luaType.displayText();
      if (valueString == null) {
      valueString = “”;

      if (keyName.equals(“message”)){
      message = valueString;
      }else if(keyName.equals(“fileName”)){
      fileName = valueString;
      }else if(keyName.equals(“subject”)){
      subject = valueString;


      Bitmap bitmapToShare = BitmapFactory.decodeFile(new File(activity.getCacheDir(), “Caches/” + fileName).toString());
      File pictureStorage = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
      File noMedia = new File(pictureStorage, “.nomedia”);
      if (!noMedia.exists())

      File file = new File(noMedia, “shared_image.png”);
      saveBitmapAsFile(bitmapToShare, file);

      Intent sendIntent = new Intent();
      sendIntent.putExtra(Intent.EXTRA_TEXT, message);
      sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);

      sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));

      activity.startActivity(Intent.createChooser(sendIntent, “Share via”));

      return 0;


      private boolean saveBitmapAsFile(Bitmap bitmapToShare, File file) {
      FileOutputStream out;
      try {
      out = new FileOutputStream(file);
      bitmapToShare.compress(Bitmap.CompressFormat.JPEG, 90, out);
      return true;
      } catch (FileNotFoundException e) {
      return false;


  12. When I use this plugin and share via Weibo, it doesn’t show any text and it can’t get the picture at “system.DocumentsDirectory”.
    I just press “send”, and show a message ( Unfortunately, weibo has stopped.)

    When I share via WeChat, it shows “Unable to load the resource” twice.

    When I share via LINE, it only sends the picture.

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=""> <s> <strike> <strong>