React on Tabris.js app launch and read launch parameters. Currently only launch by URL is supported.
Can be used in conjunction with the cordova-plugin-customurlscheme
plugin and app.launch(url)
.
Android, iOS
- The
urlLaunch
event is fired when the app has been launched through a URL.
target
: eslaunchmonitorurl
: string- The URL the app was launched through.
queryParameters
: {[key: string]: any}- Query parameters, parsed from the URL.
The most recently used parameters to launch the app by URL. Particularly useful when the urlLaunch
event listener cannot be registered early enough to handle the first triggered event.
config.xml
<plugin name="cordova-plugin-customurlscheme" spec="4.3.0">
<variable name="URL_SCHEME" value="testapp" />
</plugin>
JS
eslaunchmonitor.on({urlLaunch: ({url, queryParameters}) => {
console.log(url); // testapp://?foo=bar
console.log(queryParameters); // {foo: 'bar'}
}})
JS
import {app} from 'tabris';
app.launch('testapp://?foo=bar');