A component for opening imToken app from webpage.
yarn add git+https://github.com/xwartz/open-app
or
<script src="https://cdn.whale.token.im/open-app/index.umd.js"></script>
import OpenApp from 'open-app'
const props = {}
const openApp = new OpenApp(props)
interface Props {
schemeUrl?: string
fallbackUrl?: string
buttonStyle?: object
buttonText?: string
timeout?: number
}
const props = {
schemeUrl: 'imtokenv2://navigate?screen=DappView',
fallbackUrl: 'https://token.im/download',
buttonStyle: buttonStyle,
buttonText: isZh ? 'ęå¼ imToken' : 'Open imToken',
timeout: 2000,
}
- Render thećęå¼ imTokenćbutton.
- Render thećčÆ·ä½æēØęµč§åØęå¼ćtip, and set it display to none.
- The component will try to open imToken app with URL Scheme if user clicks thećęå¼ imTokenćbutton.
- Use a fallback url if failed to open app.