Closed sephallen closed 8 years ago
Can you show <universal-links>
preferences in your config.xml
file?
<universal-links>
<host name="bnc.lt" scheme="https">
<path url="/SCnf" />
</host>
</universal-links>
I'm using Branch.io
Try to change /SCnf
to /SCnf/*
:
<universal-links>
<host name="bnc.lt" scheme="https">
<path url="/SCnf/*" />
</host>
</universal-links>
That's how I had it before, but still the same result.
This is a correct setup for the config.xml
. Will try to reproduce the issue and then will post the result.
I have created a test Ionic project, did the setup as described in the readme here and here. Basically, prepared it to work with the Branch.io.
My config.xml
is looks like this:
<universal-links>
<host name="bnc.lt" scheme="https">
<path url="/a2Be/*" />
</host>
</universal-links>
My app.js
is like that:
// default for Ionic
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
});
// here we are subscribing for the default UL event, since it's not explicitly defined in config.xml
document.addEventListener('ul_didLaunchAppFromLink', didLaunchAppFromLink, false);
// this function should be is executed when we will launch the app from the link
function didLaunchAppFromLink(event) {
var urlData = event.detail;
alert('Did launch!');
};
As you can see, I am subscribing for the event outside the angular.module(...)
.
Then I press on the link https://bnc.lt/a2Be/test
- the app is opened, and the alert dialog is displayed. So in your case it should be the similar thing.
Thank you very much!! and thanks for the great plugin.
You're welcome )
Sorry to reopen this, your fix is working great on Android but unfortunately not on iOS. Like before, the app successfully launches, but the event is not fired. Do you have any more suggestions?
That's weird, because I actually tested this on iOS... But will check again.
It looks like it may be the device I'm testing on, its being very inconsistent.
I think this problem will go away as soon as I'll implement https://github.com/nordnet/cordova-universal-links-plugin/issues/18
Ah cool, thanks! Sorry to drag up this issue again.
No problem) You're not the first one with that problem, and until https://github.com/nordnet/cordova-universal-links-plugin/issues/18 is done - not the last one...
Just a quick update, the problem I was experiencing on iOS can be fixed here:
http://stackoverflow.com/questions/32729489/how-can-i-reset-ios-9-universal-linking-settings
Nothing to do with your plugin!
Thanks again :)
Cool :)
I'm have issues listening for the event on the Ionic platform. I am able to successfully launch the app on iOS and Android from the universal link, but I cannot obtain any of the parameters.
I have tried adding the event listener to various places, app.js in run and on ionicplatform ready, in a controller and in the index.html
Am I doing something wrong?