Created
February 24, 2022 07:36
-
-
Save iamparthaonline/fac80a2145925454e424c12dee52d3d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { FlowRouter } from "meteor/kadira:flow-router"; | |
| Meteor.startup(function () { | |
| if (Meteor.isCordova) { | |
| universalLinks.subscribe("shareEvent", function (eventData) { | |
| const shareParameters = eventData.path.split("/share")[1]; | |
| alert(`shareEvent: ${JSON.stringify(eventData)}`); // just to check event data - should be removed | |
| if (shareParameters) { | |
| const linkToOpen = `/share${shareParameters}`; | |
| FlowRouter.go(linkToOpen); | |
| } | |
| }); | |
| universalLinks.subscribe("metaEvent", function (eventData) { | |
| const linkToOpen = `/meta-data`; | |
| alert(`metaEvent: ${JSON.stringify(eventData)}`); // just to check event data - should be removed | |
| FlowRouter.go(linkToOpen); | |
| }); | |
| universalLinks.subscribe("allOtherLinkEvent", function (eventData) { | |
| console.log("Did launch application from the link: " + eventData.url); | |
| alert(`allOtherLinkEvent: ${JSON.stringify(eventData)}`); // just to check event data - should be removed | |
| FlowRouter.go(eventData.path); | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment