FuseJS/InterApp Module (JS)
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.
Deep Links - Universal and App Links
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
Apple Universal Links
- Add the associated domains in your
.unoproj
- 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.
Android App Links
- Add the associated domains in your
.unoproj
- Add the asset links file to your website
1. Add associated domains to your .unoproj
{
"Android": {
"AssociatedDomains": ["example.com", "sub.example.com"]
}
}
2. Add the asset links file to your website
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.9.1
Interface of InterApp
launchApp(uri) js
launchUri(uri) js
receivedUri js
Inherited from NativeEventEmitterModule
Emit(object[]) uno
EmitError(string) uno
Call emit("error", reason)
on the underlying JS EventEmitter.
EmitErrorObject(string) uno
Call emit("error", new Error(reason))
on the underlying JS EventEmitter.
EmitFactory(Func<Context, object[]> (Context)) uno
EmitFactory<T>(Func<Context, T, object[]> (Context, T), T) uno
On(object, Callback (Context, object[])) uno
Connect a Callback to an event.
On(object, NativeEvent) uno
Inherited from NativeModule
AddMember(NativeMember) uno
Reset : EventHandler (object, EventArgs) ux
Inherited from Module
Dispose uno
Evaluate(Context, ModuleResult) uno
Evaluate(Context, string) : ModuleResult uno
Evaluated : EventHandler (object, EventArgs) ux
EvaluateExports(Context, string) : object uno
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.