1

When I use the following method it's should open the Whatsapp for share the message, but it open the Google Play in the page of the Whatsapp...

Share.shareSingle({
  title: 'Title Test',
  message: 'Message Test',
  social: Share.Social.WHATSAPP,
})
.then(res => console.log(res))
.catch(err => {
  console.log(err);
});

In then console return: {"message": null, "success": true}

I'm using...
React Native: 0.64.0
React Native Share: 6.2.3
Android 11

When I use the example of the React Native Share it's work success, but I don't understand why don't work in my application!

1 Answers1

1

I solve this problem!

In the Android 11 some information about other apps are "blocked", using the method Share.isPackageInstalled I realized that return not installed, then to "unblock" this we need use <queries> in AndroidManifest.xml for more details read here.
Implement queries in AndroidManifest

  • can u please share code for it. like this link https://github.com/react-native-share/react-native-share/issues/1103#issuecomment-928231184 – Biplov Kumar Mar 28 '22 at 13:46
  • I can't share whole the code because the owner is a private enterprise, but you can read the docs in [here](https://react-native-share.github.io/react-native-share/docs/install#adding-queries-for-the-android-necessary-for-sdk--30) and your code should be like: – mariosantos Apr 06 '22 at 19:00