How to open an App from an actual App in React Native when the app is already installed?

Viewed 873

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 ?

1 Answers

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))
Related