/app-web-launcher

Open Native App from HTML page when some events are triggered

Primary LanguageJavaScript

app-web-launcher

Build Status undefined

This is a function that could open Native App from HTML page when some events are triggered.

install

npm i app-web-launcher -S

usage

<button onclick="goto"> open by app <button>
const AppLauncher = require('app-web-launcher')
const appLauncher = new AppLauncher()
function goto() {
   appLauncher.launch({
     deepLink: "****",
     url: "****",
     pressCb: () => {/*todo*/},
     failCb: () => {/*todo*/}
   })
}

options

key type value
ctx Object callback's context, default is window
deeplink String app's deeplink, must
url String download url if no app, must
pressCb Function callback when events were triggered, not must
failCb Function callback when no app, not must