react-open-app
Open your users native apps using deep links
Install
npm install --save react-open-app
Usage
import OpenApp from "react-open-app"; const App = <div ="App"> <h1>Hello World</h1> <OpenApp ="https://twitter.com/enzo_ferey">Twitter</OpenApp> </div>;
This library uses my library url-to-deep-link to transform URLs into deep links. If you want to redirect your users to a non supported app you can do it throught android
and ios
props:
import OpenApp from "react-open-app"; const App = <div ="App"> <h1>Hello World</h1> <OpenApp ="https://mycoolappwebsite.com" ="whatever deep link you need on Android" ="whatever deep link you need on iOS" > My app </OpenApp> </div>;
Props
Name | Type | Description |
---|---|---|
href |
String |
The URL to be opened in the user's apps |
android |
String |
Custom deep link for Android devices to be used |
ios |
String |
Custom deep link for iOS devices to be used |
blank |
Boolean |
Should the URL be open in another window in fallback case. |
Any other prop will be passed down to the underlying <a>
tag.
Test
npm run test
Build (webpack)
npm run build
License
MIT