From be038305dca1c717e62d3cc4b631be6b5c704cbc Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 21 Feb 2023 11:18:45 +0100 Subject: [PATCH 1/2] Fixed WhatsApp not being detected on Android --- plugin.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin.xml b/plugin.xml index b688ed39..81195917 100755 --- a/plugin.xml +++ b/plugin.xml @@ -89,6 +89,12 @@ + + + + + + From 526588be5f1404dd109b3975fbd0f7ff7df0e73c Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 21 Feb 2023 11:21:56 +0100 Subject: [PATCH 2/2] Fix ActivityNotFoundException when sharing to WhatsApp, Facebook, Twitter on Android 13 caused by the new "Intent filters block non-matching intents" change. --- src/android/nl/xservices/plugins/SocialSharing.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/android/nl/xservices/plugins/SocialSharing.java b/src/android/nl/xservices/plugins/SocialSharing.java index a722bc60..7d7b88e7 100644 --- a/src/android/nl/xservices/plugins/SocialSharing.java +++ b/src/android/nl/xservices/plugins/SocialSharing.java @@ -338,7 +338,12 @@ public void run() { if (peek) { callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK)); } else { - sendIntent.addCategory(Intent.CATEGORY_LAUNCHER); + // Android 13 blocks intents that don't match with the receiving app intent-filters + // In order to prevent ActivityNotFoundException the category is added to the intent only on Android 12L and below + if (Build.VERSION.SDK_INT < 33) { + sendIntent.addCategory(Intent.CATEGORY_LAUNCHER); + } + sendIntent.setComponent(new ComponentName(activity.applicationInfo.packageName, passedActivityName != null ? passedActivityName : activity.name));