-
Notifications
You must be signed in to change notification settings - Fork 534
Keep getting "open in app" banner (IOS) #2
Comments
Hi. No, that should not be happening. Application must launch directly. Did you configure smart-banner for your website? Also, what link are you opening, and what is the content of the |
@nikDemyankov Yes, smart-banner is active. The weird thing is when I use Apple's validation tool I get a empty Also weird is that if I click the open in app banner it opens the app as if it was open from a universal link, and this banner is not removable. Also, under the smart banner it show a |
@rispig Try to do this:
If everything is fine - then turn it
|
and as I said when I click the banner the plugin's functions are called as if it a universal link |
Hmm, that is strange. Ok, let's try another approach. Let's try to change the format of the
If that doesn't help, another thing to try is as described in here in Alright! So you have your signed apple-app-site-association file. Now you just need to configure your file server to host this for you. There are a few caveats:
We setup the one for all Branch integrated apps using our Node+Express link servers. Here’s the code we used in case that’s helpful: var aasa = fs.readFileSync(__dirname + '/static/apple-app-site-association');
app.get('/apple-app-site-association', function(req, res, next) {
res.set('Content-Type', 'application/pkcs7-mime');
res.status(200).send(aasa);
}); |
@nikDemyankov Changing the association file fails the apple validator and I get a message saying it doesn't find the paths value. if I add app-argument to my smart-banner meta tag content it seems that validation for smart-banner and the universal link are passing, however, I'm still getting the same open in app banner instead of seamless opening update: I just noticed that my server serves the file as |
Provided format of the Regarding validator: yes, if you test Try to modify your web server as I described in the previous post: with Also, since in
What will happen? |
@nikDemyankov |
Good question... Can you show me your |
And while we're at it - any idea why the js events are not called on cold start? (it only opens the app, but doesn't go through the event) |
Regarding JS question: |
I have the smart banner in all of the pages (I serve them with the meta tag from my server) regarding the JS, yes. |
Just wanted to test with the real page, that is not an index one and has a smart-banner on it. Don't now what is the problem, I'll keep googling, maybe something will come up. Regarding JS: I'll investigate that. Are you subscribing to the event like so in your var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
document.addEventListener('universalLink', this.onUniversalLinksEvent, false);
},
// deviceready Event Handler
onDeviceReady: function() {
console.log('Handle deviceready event if needed.');
},
// openNewsListPage Event Handler
onUniversalLinksEvent: function(event) {
console.log('Launched from UL.');
}
};
app.initialize(); |
yup ^ |
Understood, thanks for the that. Created new issue for event dispatching - #3 |
@nikDemyankov |
@rispig happy to help :) Thank you for using it and providing feedback! Sorry, that it has some issues, but will continue to work on them. |
@nikDemyankov The universal links work perfectly from links by email or other domains like google.com. For example, if I search for a page on my site from google, and then click a link google provides to my page, the app launches and the events fire. However, if I am on a page on my site and click a link that should open the app, it doesn't open the app. Example: if I am on this page: and click on a link to this page: the app won't open and I see a banner at top of page like @rispig sees in safari. If I then click on the banner, the app opens with the proper events firing If I go to google.com and click on the same exact "shirts" link as above like so: My paths in association file looks like this: my config file has: <universal-links>
<host name="www.mydomain.com" scheme="https">
<path url="/sale-products/*" event="handleDeepLink" />
</host>
</universal-links> So app always opens when clicking on a link from another domain, but from a link on the same domain, I have issues. |
@mikeduarte thanks ) Well, if https://www.mydomain.com/sale-products/shirts is opened from other sources and events are fired - then we can be sure, that plugin works as it should :) That's good. I think the problem you are facing is more like the feature from the Apple. How universal links works: when user clicks on the link - safari checks, if any of the installed apps can handle it; if app is found - safari starts it, if not - link opened as usual inside safari. I think, that when user already browsing your website - whatever link he presses - he is not gonna live the web. And I think that's fine: if I am browsing some website - I don't want to leave it until I decide so. Just tested that theory with the Twitter. If I open https://mobile.twitter.com in Safari and then press on So this is a feature, not a bug ) I should probably add that in the readme... Another thing that every developer should be aware of: |
And maybe this is also your case @rispig |
@nikDemyankov Thank you for the explanation. After writing my post and thinking about the way things were working, I started to come to the conclusion that this is exactly how Apple wants Universal Links to work. If you are in another app or on a search engine and you click on a universal link, iOS opens the app. If you are already on a domain in Safari that has universal links, prompt the user with a banner instead of launching the app. Thanks again for this great plugin - works really well. |
Thanks @mikeduarte :) |
@nikDemyankov: I have troubles with iOS, too.
best regards |
Or has the app to be published at the store, before i see a result? No, you don't need to publish the app to be able to test it. It should work as it is. One thing is special: When i open safari and then run the app in xcode, my app gets a "Back to Safari" at the top of the screen. That's a normal behaviour, it doesn't depend on Universal Links. If I create an empty Cordova app, launch emulator, open Safari in it, then run the app from the Xcode - I'll get the same "Back to Safari" button. 1. I found that the apple-app-site-association file can be unsigned with iOS9, when the server runs https and the mime type is json. Is this right? Hmm, yes, haven't notice that before, but according to the Apple documentation that should be true:
But only for iOS 9 apps, that are using Universal Links. If you are using 2. My Team ID and the App Prefix are not the same. In your documentation it looks, like it should so. I have tried both and also Developer and Distribution ID. I had no success. But the Team ID is the right one? Yes? From the Apples documentation about apple-app-site-assosiation file:
So, probably, you should use team ID. And also, look into this documentation regarding having multiple App ID prefixes. Maybe you need to try to migrate to the single one. 3. I have checked with the apple tool. I get a "passed" at Deep Links and Universal Links. Can i be sure that this part is OK? Did you use App Search Validation Tool? As I understand, it only checks 4. I have added the Capabilities and my URL is shown correct. I have 2 checkmarks at Steps. When i run the app in XCode on a device, should it work? I have a link in an email, but it always open in Safari. I see a Smart Banner, but it takes me only to the app store. It should. Maybe there is something wrong the URL you are trying to open? Try to set up some explicit one, for example: <universal-links>
<host name="mydomain.com" scheme="https">
<path url="/test" />
</host>
</universal-links> And execute Another way to check, if URL can be handled by the app is a bit hacky, but still:
|
@H0rst you can also try to use branch.io service to test the UL as described in the plugins documentation. If it will work - then you have configured data in Member Centre properly. After that you'll have to configure |
@nikDemyankov: Thank you for the informations. The same app works on Android just fine (you remember, i had the timing problem). So config.xml should be OK. As i understand it, if the app is not started, when a link is used, then it is no error at url recognization. It is a problem, that the url is not assigned to the app. PS: Yes, i have tested with the App search validation tool. And i have also tried with signing the app-site-assosiation-file. When i use a non existing URL (with a path in config.cml) i get a 404 error in safari. I have double and trible checked all things and removed and reinstalled the plugin. But no success. |
Most likely. How Universal Links works on iOS (sort of): Make sure, that your If I'll come up with some other suggestions - I'll add them. But at the moment - don't know where the problem lies. Just a stupid thought, but still: make sure, that you are running the app on iOS 9 device, since UL is for iOS 9 and above :) |
@nikDemyankov thank you. i have checked all of this. And i have found this open issue at the apple forum: https://forums.developer.apple.com/thread/20592 |
@H0rst hope it will work for you. Because it seems that this is the only thing left in there. As a test you can create a totally new app. In the
That's why I said, that it is stupid thought :) |
@nikDemyankov While waiting for the change, i updated Android to version 1.1. But it won't work. I changed the subscription to the new version. When i click on a link the device let me open it in my app. but the universal link event is not executed. I have tried |
@H0rst can you, please, create a separate issue for that, since current one is huge already and will close it eventually :) we can continue discussion regarding Android in there. |
@nikDemyankov just for your Information: I had changed my App ID to have my Team ID as Prefix (i has taken some time, because i have to contact apple developer support for this). It has not worked. But i have left the code in the app and submited it to the app store. Today i have released this version. And after installing the update from the app store, universal links are working. \o/ |
@H0rst Thanks for the info, glad to hear that :) Although, it is really strange, that UL didn't work until the actual release even after changing AppID to TeamID. But glad that it worked out :) |
👋 Hi! Thank you for your interest in this repo. 😢 We are not using nordnet/cordova-universal-links-plugin anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork. 🔒 This will now be closed & locked. ℹ️ Please see #160 for more information. |
After doing all the steps whenever I access my site I get a smart-banner like "open in app"
which activates the applinks event of the plugin.
Is this how it suppose to behave? because I was under the impression that if I click/navigate to the url configured the app will open without going through Safari and without making the user do it explicitly
The text was updated successfully, but these errors were encountered: