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

Messenger Share on iOS not working for me #1510

Open
joeljerushan opened this issue Mar 16, 2024 · 1 comment
Open

Messenger Share on iOS not working for me #1510

joeljerushan opened this issue Mar 16, 2024 · 1 comment
Labels

Comments

@joeljerushan
Copy link

Hi, im using following Versions of React Native and React Native Share

"react-native": "0.70.6",
"react-native-share": "^10.0.2",

As in documentation im trying to share my Firebase generated Dynamic URL to messenger like following code, but when i tap its not opening messenger app,

const shareOptions = {
      message: 'Check this out!',
      url: 'MY_SHARABLE_LINK',
      social: Share.Social.MESSENGER,
      appId: 'MY_APP_ID',
    };

    try {
      const ShareResponse = await Share.shareSingle(shareOptions);
      console.log(ShareResponse);
    } catch (error) {
      console.log('Error =>', error);
    }

if i try Share.open it opens native Share popup instead of messenger.

await Share.shareSingle(shareOptions)
      .then((res) => {
        console.log(res);
      })
      .catch((err) => {
        err && console.log(err);
      });

but when i try Linking.openURL(fb-messenger://share?link=${link}); this single line of code it works perfectly. my question is does this plugin don't have such feature and should we using Linking library instead or any correct way to do with react-native-share library ?

@ebellumat
Copy link

You need to add this key on your Info.plist file.

<key>LSApplicationQueriesSchemes</key>
<array>
	<string>...existent values...</string>
	<string>fb-messenger</string>
</array>
		

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants