-
Notifications
You must be signed in to change notification settings - Fork 534
Can universal links work in a SPA scenario? #36
Comments
If you want the app to be open on all links, like <universal-links>
<host name="ttapp.nl" scheme="https" />
</universal-links> When you execute <head>
<link rel="alternate" href="android-app://<YOUR_APP_PACKAGE_NAME>/https/ttapp.nl" />
<!-- Your other stuff from the head tag -->
</head>
<body>
<!-- Your page content -->
</body> So my guess is that you need to add on your If you don't want to do any changes in index.html - you can use Sitemap. This way, you can define this link tag in it, and avoid your web content being crawled by Google. |
That was also my first thought, but I don't seem to get it to work. |
In more details regarding web integration of the Android app and website you can read in this section of the documentation. You need 3 things:
Also, a good video about all of that is that one.
Your app's From the google documentation:
I see, that you already added |
I did all these steps, except 'publish the app'. I normally want to see things work before I publish, but I gather that won't work for these kind of applications. Now I can only hope I can do a 'test' by publishing the app to the beta-channel of the Play Store... |
Hmm, all this time I used Chrome for testing. I was visiting a webpage that contains a deep link to my website-address. Chrome just opened the page on the site. However, if I visit this same page from the default browser on my phone it opens the app. Using the same link in an e-mail or in a Whatsapp conversation all open the app perfectly. Chrome however does not. Is this a Chrome bug/issue? Or is it supposed to work like this? (but then, why?) |
Sorry for not answering sooner: been really busy... That's an interesting notice. If it works for email and other browsers - then it's totally has something to do with the Chrome. After some googling found, that you are not the only one, who stumbled upon "Chrome not supporting deep linking". For example, this and that. But in your case you are using regular https scheme, so it should work in chrome... Will try to do some more research. By the way, have you tried that on other devices with chrome? Tried to reinstall chrome on the device? |
I have now tested this with a fresh install of Chrome on another device and there I see the same behavior. Firefox does the same, it also opens the site, ignoring the installed app. |
Thanks for the testing. Don't have a way to test it at the moment myself. That is a strange behaviour from those browsers. Logically, if a link is opened fine from email or messenger, or some default browser - then the intent is sent properly by those apps and captured as it should by yours. When you open the browser and tries to open the link as a search result in Chrome/Firefox - then they are not sending any intents to the app, or ignoring it at all. Why they are doing so - that's a good question. For example, they just handle all http/https links on they're own and don't care about other stuff. Another reason can be that the app is not actually connected to the site via Google Play console as stated here. Can't find anything more useful at the moment. Will keep looking as well. |
(comment moved from wrong issue) |
Hi, I am having the same problem as TonivdW. |
Hi, @TonivdW did you manage to solve this somehow? |
No, I have not. Apparently it is up to the app (in this case Chrome) to decide how to handle plain https url schemes. Chrome decides to ignore the presence of a UL config and seems to decide: if you browsing within Chrome, you want to stay in Chrome, even if a UL config for the site is present. Like I showed some comments back, Facebook has yet another approach, opening is an own webview within Facebook and then offering the possibility to switch to the app. It's a mess... |
Understood, thanks for the info. |
See "Universal Links Still Don’t Work Everywhere" at the end of this post: https://blog.branch.io/ios-9.2-deep-linking-guide-transitioning-to-universal-links |
@conor-mac-aoidh good info, thanks. |
👋 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. |
I have the following use case:
My application is a SPA. The same code that is running the site is also running the app.
I do not want my site crawled and indexed via Google, except for the home page, so I have
in the index.html
I have tens of thousands of subpages like: https://ttapp.nl/#/poule/1011994
I want all these pages to open in the app, wherever on the internet such a link is clicked.
For Android I have configured universal-links and tested it locally through adb. These subpages all work as expected. But I can't get my head around what to configure for the
tag. Surely I can't possible list all subpages, and since there is just one occurrence of the HEAD- tag, being a SPA, all the subpages share this same declaration.
Can this be made to work? Any advice would be appreciated.
The text was updated successfully, but these errors were encountered: