Package Exports
- react-native-app-link
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-app-link) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Native App Link
Easily link to other apps in React Native. If the app isn't installed on the user's phone, open the App Store or Play Store link instead.
Installation:
npm i -S react-native-app-link
Usage:
import AppLink from 'react-native-app-link';
AppLink.maybeOpenURL(url, { appName, appStoreId, playStoreId }).then(() => {
// do stuff
})
.catch((err) => {
// handle error
});
AppLink.openInStore(appStoreId, playStoreId).then(() => {
// do stuff
})
.catch((err) => {
// handle error
});
API:
maybeOpenURL(url, config)
Opens link if app is present. If not, it opens an app store to prompt the user to download it.
url
: (String) a url that points to the content you want to open.
config
: (Object) a set of fallback urls if the app requested does not exist locally.
config.appName
: (String) the app's name you're linking into.
config.appStoreId
: (String) the app's ID on the App Store (iOS). Example: { appStoreId: 'id529379082' }
config.playStoreId
: (String) the app's package identifier on the Play Store (Android). Example: { playStoreId: 'me.lyft.android' }
openInStore(appStoreId, playStoreId)
Opens an app store to the listing requested.
appStoreId
: (String) the app's ID on the App Store (iOS). Example: 'id529379082'
playStoreId
: (String) the app's package identifier on the Play Store (Android). Example: 'me.lyft.android'
If there are any issues file an issue above and don't hesitate to spin up a PR and contribute!