[Android] shareSingle opens Play Store instead of the installed app (WhatsApp)
dhatGuy opened this issue · comments
Joseph commented
Steps to reproduce
- Call shareSingle with the following parameters:
Share.shareSingle({
title: 'My Share Title',
message: 'Check out this cool link!',
url: 'https://example.com',
social: Share.Social.WhatsApp,
})
.then((result) => {
// Handle the result
})
- The Play Store page for the social app opens, even if the app is installed.
Expected behavior
The shareSingle
method should directly open the installed WhatsApp app for sharing, rather than redirecting to the Play Store.
Actual behavior
The shareSingle
method currently opens the Play Store page for WhatsApp app, regardless of whether the app is already installed on the device.
Environment
- React Native version: 0.73.2
- React Native platform + platform version: Android 13
- Typescript version (if using typescript): 5.3.3
react-native-share
Version: 9.4.1
alantom1423 commented
In AndroidManifest.xml use com.whatsapp
instead of com.whatsapp.android
<queries>
<package android:name="com.whatsapp" />
</queries>
If you are checking for package installation check with com.whatsapp
await Share.isPackageInstalled(
'com.whatsapp' ,
);