Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] shareSingle opens Play Store instead of the installed app (WhatsApp) #1501

Closed
dhatGuy opened this issue Feb 3, 2024 · 2 comments
Closed
Labels
bug stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@dhatGuy
Copy link

dhatGuy commented Feb 3, 2024

Steps to reproduce

  1. 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
})
  1. 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

@dhatGuy dhatGuy added the bug label Feb 3, 2024
@alantom1423
Copy link

alantom1423 commented Mar 9, 2024

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'  ,
);

Copy link

github-actions bot commented May 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open

@github-actions github-actions bot added the stale There has been a lack of activity on this issue and it may be closed soon. label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants