nordnet / cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
https://github.com/nordnet/cordova-universal-links-plugin/issues/160
MIT License
348 stars 531 forks source link

Make JS module, that will handle the UL events #18

Closed nikDemyankov closed 8 years ago

nikDemyankov commented 8 years ago

As stated in https://github.com/nordnet/cordova-universal-links-plugin/issues/3 - we need a module, that does something like this:

function onDeviceReady() {
  console.log('deviceready');

  // set handler for the event
  universalLinks.on('event_name', onULOpen);
};

function onULOpen(event) {
  // handle the event
}

Internally, it will store the events, received from the native side; and then universalLinks.on(...) is called - send them to the callback. Basically, you are subscribing to the event through the plugins module.

alexbuijs commented 8 years ago

This would definately be very useful! I am now working around the timing issue by setting event details in localstorage from index.html and then acting on it when the app has finished loading.