Do we have any helper functions to handle Firebase dynamic links in the Svelte + Sapper app?
https://firebase.google.com/docs/dynamic-links
We want to take the user to a particular screen instead of the landing page.
I found firebase plugins for flutter, Cordova.
Flutter plugin
https://pub.dev/packages/firebase_dynamic_links
void initDynamicLinks() async {
FirebaseDynamicLinks.instance.onLink(
onSuccess: (PendingDynamicLinkData dynamicLink) async {
final Uri deepLink = dynamicLink?.link;
if (deepLink != null) {
Navigator.pushNamed(context, deepLink.path);
}
},
onError: (OnLinkErrorException e) async {
print('onLinkError');
print(e.message);
}
);
final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.getInitialLink();
final Uri deepLink = data?.link;
if (deepLink != null) {
Navigator.pushNamed(context, deepLink.path);
}
}
Cordova Plugin
https://www.npmjs.com/package/cordova-plugin-firebase-dynamiclinks
getDynamicLink
Determines if the app has a pending dynamic link and provide access to the dynamic link parameters.
cordova.plugins.firebase.dynamiclinks.getDynamicLink().then(function(data) {
if (data) {
console.log("Read dynamic link data on app start:", data);
} else {
console.log("App wasn't started from a dynamic link");
}
});
onDynamicLink(callback)
Registers callback that is triggered on each dynamic link click.
cordova.plugins.firebase.dynamiclinks.onDynamicLink(function(data) {
console.log("Dynamic link click with data:", data);
});
Do we have any helper functions to handle Firebase dynamic links in the Svelte + Sapper app?
https://firebase.google.com/docs/dynamic-links
We want to take the user to a particular screen instead of the landing page.I found firebase plugins for flutter, Cordova.
Flutter plugin
Cordova Plugin