Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xwartz/open-app
🐋 A component for opening imToken app from webpage.
https://github.com/xwartz/open-app
imtoken url-scheme
Last synced: 5 days ago
JSON representation
🐋 A component for opening imToken app from webpage.
- Host: GitHub
- URL: https://github.com/xwartz/open-app
- Owner: xwartz
- License: mit
- Created: 2019-07-31T08:11:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T20:09:12.000Z (over 1 year ago)
- Last Synced: 2024-10-31T00:11:52.159Z (about 2 months ago)
- Topics: imtoken, url-scheme
- Language: TypeScript
- Homepage:
- Size: 737 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# open-app
A component for opening imToken app from webpage.
### Usage
#### install:
```bash
yarn add git+https://github.com/xwartz/open-app
```or
```html
```
#### Basic Usage:
```ts
import OpenApp from 'open-app'
const props = {}
const openApp = new OpenApp(props)
```#### Parameters:
```ts
interface Props {
schemeUrl?: string
fallbackUrl?: string
buttonStyle?: object
buttonText?: string
timeout?: number
}
```#### Default Parameters:
```ts
const props = {
schemeUrl: 'imtokenv2://navigate?screen=DappView',
fallbackUrl: 'https://token.im/download',
buttonStyle: buttonStyle,
buttonText: isZh ? '打开 imToken' : 'Open imToken',
timeout: 2000,
}
```### How it works
1. Render the「打开 imToken」button.
2. Render the「请使用浏览器打开」tip, and set it display to none.
3. The component will try to open imToken app with URL Scheme if user clicks the「打开 imToken」button.
4. Use a fallback url if failed to open app.