{"action":"closed","issue":{"url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/18","labels_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/18/comments","events_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/18/events","html_url":"https://github.com/nordnet/cordova-universal-links-plugin/issues/18","id":119026458,"number":18,"title":"Make JS module, that will handle the UL events","user":{"login":"nikDemyankov","id":13447778,"avatar_url":"https://avatars.githubusercontent.com/u/13447778?v=3","gravatar_id":"","url":"https://api.github.com/users/nikDemyankov","html_url":"https://github.com/nikDemyankov","followers_url":"https://api.github.com/users/nikDemyankov/followers","following_url":"https://api.github.com/users/nikDemyankov/following{/other_user}","gists_url":"https://api.github.com/users/nikDemyankov/gists{/gist_id}","starred_url":"https://api.github.com/users/nikDemyankov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikDemyankov/subscriptions","organizations_url":"https://api.github.com/users/nikDemyankov/orgs","repos_url":"https://api.github.com/users/nikDemyankov/repos","events_url":"https://api.github.com/users/nikDemyankov/events{/privacy}","received_events_url":"https://api.github.com/users/nikDemyankov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/milestones/2","html_url":"https://github.com/nordnet/cordova-universal-links-plugin/milestones/v1.1.0","labels_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/milestones/2/labels","id":1430970,"number":2,"title":"v1.1.0","description":null,"creator":{"login":"nikDemyankov","id":13447778,"avatar_url":"https://avatars.githubusercontent.com/u/13447778?v=3","gravatar_id":"","url":"https://api.github.com/users/nikDemyankov","html_url":"https://github.com/nikDemyankov","followers_url":"https://api.github.com/users/nikDemyankov/followers","following_url":"https://api.github.com/users/nikDemyankov/following{/other_user}","gists_url":"https://api.github.com/users/nikDemyankov/gists{/gist_id}","starred_url":"https://api.github.com/users/nikDemyankov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikDemyankov/subscriptions","organizations_url":"https://api.github.com/users/nikDemyankov/orgs","repos_url":"https://api.github.com/users/nikDemyankov/repos","events_url":"https://api.github.com/users/nikDemyankov/events{/privacy}","received_events_url":"https://api.github.com/users/nikDemyankov/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":3,"state":"open","created_at":"2015-11-26T11:24:49Z","updated_at":"2015-12-17T12:34:11Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-11-26T11:24:51Z","updated_at":"2015-12-17T12:34:11Z","closed_at":"2015-12-17T12:34:11Z","body":"As stated in https://github.com/nordnet/cordova-universal-links-plugin/issues/3 - we need a module, that does something like this:\r\n```js\r\nfunction onDeviceReady() {\r\n  console.log('deviceready');\r\n\r\n  // set handler for the event\r\n  universalLinks.on('event_name', onULOpen);\r\n};\r\n\r\nfunction onULOpen(event) {\r\n  // handle the event\r\n}\r\n```\r\n\r\nInternally, 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.\r\n"}}