Skip to main content

Deep linking with fin and fins protocols

The RVM permits deep linking to a Here™ Core program from anywhere that can invoke a link, such as a browser, email client, or another Here™ Core program. This works similarly to deep links on mobile platforms that invoke a mobile app rather than a website. The RVM uses a custom protocol handler for URLs that start with fin: or fins:, to invoke the program, if not already running, and to pass context to a Here™ Core program via the URL parameter.

Example deep link:

fins://mydomain.com/path-to-manifest/app.json?$$parameter1=value1&$$parameter2=value2

Note that the RVM passes to the program only URL parameters that are prefixed with two dollar signs ($$). For URL parameters with one or zero dollar signs, the RVM treats them as part of the base URL.

A program needs to handle URL parameters in both of two cases:

  • When the app is first launched, the initial parameters can be accessed via Application.getInfo().

  • When the app is invoked when it is already running, the args object on the run-requested application event contains them.

Retrieving arguments from the initial launch:

// Application.getInfo can be used to retrieve initial launch args
const thisApp = fin.Application.getCurrentSync();
const info = await thisApp.getInfo();
const { userAppConfigArgs } = info.initialOptions;
console.log(userAppConfigArgs.parameter1);

Getting arguments when the app is already running:

// If the app is already running, parameters are passed through the 
//“run-requested” event
thisApp.addListener("run-requested", function (event) {
if(event.userAppConfigArgs){
//args parameter contains deep link context
console.log(event.userAppConfigArgs.parameter1);
}
})