Skip to content

xwartz/open-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Ā 

History

32 Commits
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 

Repository files navigation

open-app

A component for opening imToken app from webpage.

Usage

install:

yarn add git+https://github.com/xwartz/open-app

or

<script src="https://cdn.whale.token.im/open-app/index.umd.js"></script>

Basic Usageļ¼š

import OpenApp from 'open-app'
const props = {}
const openApp = new OpenApp(props)

Parametersļ¼š

interface Props {
  schemeUrl?: string
  fallbackUrl?: string
  buttonStyle?: object
  buttonText?: string
  timeout?: number
}

Default Parameters:

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.

About

šŸ‹ A component for opening imToken app from webpage.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published