app.deeplink
is the instance of DeepLink API
, which provide functions to enable DeepLink
to your app content.
NOTE : In order to enable Deep Link to your app, you have to do all the following configurations.
First Update Your Package.JSON
In order to enable Deep Link
to your app, you’ll have to define array of objects with following attributes in package.json
file of your app
deep-link
attribute in package.json
which is array of objects
of scheme
and host
You can define as many scheme
and host
you want
scheme
host
{
"deep-link":[
{
"scheme" : "http",
"host" : "android-js.github.io"
},
{
"scheme" : "https",
"host" : "android-js.github.io"
}
]
}
whenever user click on defined links or hosts
, your app will be listed as suggestion
to open
that link in your app
app.deeplink.getLink()
Returns a link
on which user clicked
to open
that in your app
NOTE: returns link if available otherwise -1
An example of above code:
// In views of your app
let link = app.deeplink.getLink();
if(link != '-1') {
app.loadURL(link);
}