The InterApp API allows you to launch other apps, as well as respond to being launched via URI schemes.

This module is an EventEmitter, so the methods from EventEmitter can be used to listen to events.

You need to add a reference to "Fuse.Launcher" in your project file to use this feature.

Example

var InterApp = require("FuseJS/InterApp");

InterApp.on("receivedUri", function(uri) {
    console.log("Launched with URI", uri);
});

InterApp.launchUri("https://fuseopen.com/");

In the above example we're using the EventEmitter on method to listen to the "receivedUri" event.

For the receivedUri event to be triggered, you need register a custom URI scheme for your app, as shown here.

You can receive the receivedUri event, mentioned above, for associated web urls that have been tapped on in other apps.

Apple: https://developer.apple.com/ios/universal-links

Android: https://developer.android.com/training/app-links

  1. Add the associated domains in your .unoproj
  2. Add the Apple App Site Association file to your website
1. Add associated domains to your .unoproj
{
    "iOS": {
        "SystemCapabilities": {
            "AssociatedDomains": ["applinks:example.com", "applinks:sub.example.com"]
        }
    }
}
2. Add the Apple App Site Association file to your website

Apple-app-site-association file format

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "<team identifier>.<bundle identifier>",
                "paths": [<paths>]
            }
        ]
    }
}

Basic example, this allows all urls of the domain to be validated:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "1234567890.com.mypackage.myapp",
                "paths": ["*"]
            }
        ]
    }
}

Place this file either in your site’s .well-known directory, or directly in its root directory. If you use the .well-known directory, the file’s URL should match the following format:

https://<fully qualified domain>/.well-known/apple-app-site-association

Tip: make sure you can access the file and view the JSON of the apple-app-site-association file from a browser.

Full reference: https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links?language=objc

  1. Add the associated domains in your .unoproj
  2. Add the asset links file to your website
1. Add associated domains to your .unoproj
{
    "Android": {
        "AssociatedDomains": ["example.com", "sub.example.com"]
    }
}

Example:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "com.example.puppies.app",
      "sha256_cert_fingerprints":
      ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
    }
  },
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "com.example.monkeys.app",
      "sha256_cert_fingerprints":
      ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
    }
}]

Each group represents an app, you will likely need one for your development version and one for your release version of your app.

To get the sha256_cert_fingerprints, use the following:

keytool -list -v -keystore my-release-key.keystore

To get the sha256 for the development version of exporting with fuse, use with android as the password: keytool -list -v -keystore ~/.android/debug.keystore

Place this file in your site’s .well-known directory. The file’s URL should match the following format:

https://domain.name/.well-known/assetlinks.json

Location

Namespace
Fuse.Reactive.FuseJS
Package
Fuse.Launcher.InterApp 2.0.1
Show Uno properties and methods

Interface of InterApp

launchUri(uri) js

Requests the system to launch an app that handles the specified URI.

receivedUri js

Called when the app is launched via its own URI scheme.

Inherited from NativeEventEmitterModule

Emit(object[]) uno

Call emit with the given arguments on the underlying JS EventEmitter.

Inherited from NativeModule

Inherited from Module

GetFile : FileSource uno

Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces