3

I'm using this library for deep linking is my React Native application (only IOS is concerned)

If the app isn't installed it successfully opens the apple store .

But the problem is even if the app is installed, it opens the apple store with open button.

Here is my code

AppLink.maybeOpenURL('my apple store app', { appName: 'xxxxx', appStoreId: 'xxxxxx', appStoreLocale: 'xxxxxx', playStoreId: undefined }).then(() => {
   // do stuff
})
  .catch((err) => {
    // handle error
  });

Is there something i am doing wrong ?

Amine
  • 2,241
  • 2
  • 19
  • 41
  • Does this answer your question? [How to open an external app from react native app?](https://stackoverflow.com/questions/42536216/how-to-open-an-external-app-from-react-native-app) – Ethan Hill Jun 30 '20 at 15:49
  • 1
    @EthanHill thank you for taking time to answer, but sadly it doesn't, this library suggests that if the app is installed it will open it BUT it didn't – Amine Jun 30 '20 at 15:53
  • If you have a link to a specific page in an app, for instance https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz you can just add the link to a button using `Linking` from `react-native`for instance `onPress = {() => Linking.openURL(myUrl)}` and it will automatically open the app if it exists on the device. – thedeg123 Jun 30 '20 at 16:14

1 Answers1

0

It can be done through Linking.

import {Linking} from 'react-native';

and if you want to open any put its url like if you want to open facebook can do:

Linking.openURL(`fb://profile/${pageId}`)
  .catch(err => console.error('An error occurred', err))
Adeel
  • 134
  • 3