Here is my actual apple-app-site-association file:
{
"applinks": {
"apps": [],
"details": [ {
"appID": "XXXXXXXXX.com.example.app",
"paths": [
"NOT /Registration",
"/*"
]
}]
}
}
I would like to allow every urlendpoint to working as universal link, expect the example.com/Registration/whatever
But the above code not working. If I click on a registration link, it open my application.
I tried a lot of version of this file eg: "NOT /Registration/*", "NOT /Registration*", "NOT /Registration/", but no one work.
What is wrong?
UPDATE:
Here is my full example registration link:
https://example.com/Registration/AccountActivation?activationCode=XXXX
I do not have a fix for your problem, but I can give you a possible explanation. I'm leaving this here for reference in the hopes that I overlooked something.
Did you try reinstalling the app after changing the file? I had a simmilar problem not long ago. It seems that apple is only fetching the file once on install. From the orininal source:
During my troubleshooting, I discovered it’s best to verify an app is
making the HTTPS request for the apple-app-site-association file. It’s
important to know that apps only attempt to this once per
installation. The request occurs the first time an app is launched
after installation. Furthermore, force closing an app and then
launching it will NOT trigger the app to reload
apple-app-site-association.
via https://medium.com/#barsh/my-first-date-with-ios-universal-links-90dfabc88bb8#.wyrslx2di
As I said, there seems to be no solution on updating the file without a reinstall of the app.
NOT /Registration is a match for yourdomain.com/Registration but not any subpath e.g. /Registration/AccountActivation....
I believe this should achieve what you're looking for:
{
"applinks": {
"apps": [],
"details": [ {
"appID": "XXXXXXXXX.com.example.app",
"paths": [
"NOT /Registration/*",
"/*"
]
}]
}
}
Related
I have an AASA file which is working great so far. Basically it routes everything to go inside my app:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "my.app.id",
"paths": [
"/uni/*",
"*"
]
}
]
}
}
So, every link the user click which has mydomain.com redirects to my app! Which is great so far!
But my loved company had the greatest idea to mess with my sleepy nights and decided to release a new product which is working under newproduct.mydomain.com so in the newsletter emails, every time our users tap on a link, it opens my app... although it should be redirected to the web.
What we tried to do is to create a blacklist inside the AASA, but it didn't work... reading around we saw that the user should reinstall the app in order to make it work. The way we did the AASA with blacklist is:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "my.app.id",
"paths": [
"NOT /uni/*",
"*"
]
}
]
}
}
The solution we are seeing is to threat the link inside the app and if we see is coming from newproduct.mydomain.com we redirect the user to safari, but that will require a release.
My question is... is it possible to make every link in newproduct.mydomain.com to be redirected to the web without an app release?
We've implemented Universal Links as described here so that users can confirm their account. We recently introduced some some new controllers/pages to our site and we found that all links will open the app regardless of what is in the apple-app-site-association file. I've checked our configurations and can't find an issue.
Before new pages added:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "XXXXXXXX.com.mybundle.identifier",
"paths": ["*"]
}
]
}
}
After new pages added:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "XXXXXXXX.com.mybundle.identifier",
"paths": ["NOT /about/*", "NOT /home/*", "*"]
}
]
}
}
Things to note:
I've tried several variations in the paths including "NOT /about*" or "NOT *" and all links will still open the app.
AASA Validator returns all green.
I've versioned and uninstalled between each test.
Any thoughts on what we could check next?
In the last section of document about allowing_apps_and_websites_to_link_to_your_content, it says:
Use wildcards in path strings within the paths array to specify
sections of your website. For example, append * to a specific URL,
such as /videos/samples/2015/, to specify all paths below
/videos/samples/2015/. Use ? to match any single character, such as
/photography//samples/201?/mypage. Use a standalone * to specify your
entire website.
And
Identify an area that should not be handled by adding “NOT ”
(including a space after the T) to the beginning of the path string.
So, in you second paths, you use NOT and * at the same time which is contradictory. I think you should change it to:
"paths": ["NOT /about/*", "NOT /home/*"]
Or something like
"paths": ["NOT /about/*", "NOT /home/*", "/vailddomain/*"]
I have not test it but I think it's probably the right solution.
I am working on universal link. I had some urls to open in my application.
I had added portal.xyz.com in associated domains.
Problem : My application opens on https://portal.xyz.com/. I want to continue this URL to browser. Just want to open URL that having start path https://portal.xyz.com/da/notification**.
How can I do this?
Please keep same associated domain in your project and you need to handle this case from apple-app-site-association file that you have uploaded in server,
{
"applinks": {
"apps": [],
"details": [
{
"appID": "9JA89QQLNQ.portal.xyz.com"//keep your Apple Id of you application,
"paths": [ "/da/notification/*"]
}
]
}
}
Ref: https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html
Hope it will be helpful.
I implemented Universal Links. The apple-app-site-association is structured as follows:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "APPID.my.awesome.newspaper",
"paths": [ "NOT /webapp/issue/*/ads/*", "/webapp/issue/*/*.html" ]
}
]
}
}
For some reason the first path with the NOT is not considered at all.
For example:
These URL's are handled as expected:
awesome-newspaper.my/webapp/issue/sz/2016-01-22/page_2.157908/article_1.2828646/article.html
awesome-newspaper.my/webapp/issue/sz/2016-01-22/page_2.157908/page.html
This URL should not be handled as Universal Link and should always open in Safari.
awesome-newspaper.my/webapp/issue/sz/2016-01-22/ads/ad_145/index.html
But it always opens in the App as well.
Can someone please help me out?
i think the problem is that your URL matches both cases, which is then making the results unpredictable.
try making the paths mutually exclusive. if thats not possible you may need to change the URL structure.
UPDATE:
it's possible that your NOT string is ill formatted, try changing it to: "NOT /webapp/issue/*/ads/*/*.html"
There are several other posts which say universal links are not working. I have a different issue where these links are working, however I want to exclude some specific url's on my website from launching the app and this is not working.
As documented here:
https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
I have implemented the necessary steps for universal link including uploading the apple-app-site-association file.
The file looks like this example:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "AB1CDEFGHI.com.mydomain.myapp",
"paths": [ "*", "NOT /help/" ]
}
]
}
}
The intention here is if a user clicks www.mydomain.com/help it will not launch the app but open this page in safari. However this link opens the app.
I have tried several versions of this path including:
/help/*
/help/
/help
help
none of these provide the desired exclusion functionality.
Has anybody been able to implement this type of exclusion?
To answer my own question, by changing:
[ "*", "NOT /help/" ]
to:
[ "NOT /help/", "*" ]
It worked as expected. The order of the paths matters and by putting "*" first the system will find a match on the first path and will launch the app.
Simple enough...
You should use "NOT /help/" having the NOT inside the string.
Also, I suggest you look at AppsFlyer's solution for Universal Links. It may be a good alternative (using another applinks path).