diff --git a/package.json b/package.json index 190d4d8a..549d5fa0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-x-socialsharing", - "version": "5.6.4", + "version": "5.6.5", "description": "Share text, images (and other files), or a link via the native sharing widget of your device. Android is fully supported, as well as iOS 6 and up. WP8 has somewhat limited support.", "cordova": { "id": "cordova-plugin-x-socialsharing", diff --git a/plugin.xml b/plugin.xml index 831896f9..ed433e5e 100755 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="5.6.5"> SocialSharing diff --git a/src/android/nl/xservices/plugins/SocialSharing.java b/src/android/nl/xservices/plugins/SocialSharing.java index aa511121..e72446f4 100644 --- a/src/android/nl/xservices/plugins/SocialSharing.java +++ b/src/android/nl/xservices/plugins/SocialSharing.java @@ -87,10 +87,10 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } else if (ACTION_SHARE_VIA_TWITTER_EVENT.equals(action)) { return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), "twitter", null, false, true); } else if (ACTION_SHARE_VIA_FACEBOOK_EVENT.equals(action)) { - return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), "com.facebook.katana", null, false, true, "com.facebook.composer.shareintent"); + return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.isNull(3) ? args.getJSONArray(2) : null, args.getString(3), "com.facebook.katana", null, false, true, "com.facebook.composer.shareintent"); } else if (ACTION_SHARE_VIA_FACEBOOK_WITH_PASTEMESSAGEHINT.equals(action)) { this.pasteMessage = args.getString(4); - return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), "com.facebook.katana", null, false, true, "com.facebook.composer.shareintent"); + return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.isNull(3) ? args.getJSONArray(2) : null, args.getString(3), "com.facebook.katana", null, false, true, "com.facebook.composer.shareintent"); } else if (ACTION_SHARE_VIA_WHATSAPP_EVENT.equals(action)) { if (notEmpty(args.getString(4))) { // abid return shareViaWhatsAppDirectly(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), args.getString(4));