Dibyajyoti Mishra
Dibyajyoti Mishra

Reputation: 504

shareSingle from react-native-share does not work for WhatsApp in Android 11

React Native Share singleShare is not working. Tried out everything as mentioned in the blog post here:

https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9

Still no luck. Please help.

Code snapshot:

let shareOptions = {
    title: 'Share via WhatsApp',
    message: 'Hey Check out this product',
    type: 'image/jpeg',
    url: urlString,
    filename: 'Awesome_Product',
    social: Share.Social.WHATSAPP,
    whatsAppNumber: 'number',
  };

Share.shareSingle(shareOptions)
      .then(resp => {
        console.log(resp);
      })
      .catch(_err => showToast('WhatsApp is not installed on the device.'));

Upvotes: 3

Views: 1666

Answers (1)

Anton
Anton

Reputation: 970

Did you actually add the <package android:name="com.whatsapp" /> to the android manifest?

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

Upvotes: 0

Related Questions