npm i app-web-launcher -S
<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 |