FiberJW / react-native-app-link

Easily link to other apps with React Native.
MIT License
573 stars 34 forks source link

Where can I find app url? #22

Open ivankdev opened 3 years ago

ivankdev commented 3 years ago

ok there is example of usage like

import AppLink from 'react-native-app-link';

AppLink.maybeOpenURL(url, { appName, appStoreId, appStoreLocale, playStoreId }).then(() => {
  // do stuff
})
.catch((err) => {
  // handle error
});

appName, appStoreId, appStoreLocale, playStoreId - more or less clear where to get

Question: Where can we find url parameter - obviously it should be like whatsapp://? But how as example it should be for some another JustEatApp https://play.google.com/store/apps/details?id=com.justeat.app.uk&hl=ru&gl=US ?

How you detect deeplink to open another app itself, not playstore with app?

ivankdev commented 3 years ago

@gastondisacco any clues?

FiberJW commented 3 years ago

It depends on the app you're trying to link to. Some apps have documentation on deep-linking into them via their URL scheme like Lyft: https://developer.lyft.com/docs/deeplinking

FiberJW commented 3 years ago

If all you know is the package name, and your only platform is Android, you could try sending an intent: https://reactnative.dev/docs/linking#sendintent

Untested Example:

Linking.sendIntent('com.justeat.app.uk');