EddyVerbruggen / SocialSharing-PhoneGap-Plugin

👨‍❤️‍💋‍👨 Cordova plugin to share text, a file (image/PDF/..), or a URL (or all three) via the native sharing widget
MIT License
1.78k stars 905 forks source link

canShareVia is returning error call back for WhatsApp on Android 11 #1174

Open bascoder opened 1 year ago

bascoder commented 1 year ago

canShareVia is returning error call back for WhatsApp on Android 11 when the target SDK is API Level 30 or higher.

Using window.plugins.socialsharing.share with Whatsapp selected it works.

This has to do with a breaking change in Android 11. The error can be resolved by adding queries to you AndroidManifest file:

<manifest>
  ...
  <queries>
    <package android:name="com.whatsapp" />
  </queries>
</manifest>