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?
Related
I managed to make Universal Linking working in our App 99% to perfection, but I'm still struggling to make it work reliably within Safari.
This is what happens:
If I get a link from either our www or non-www domain in Gmail, both launch the apps correctly;
If I write the URL from either our www or non-www domain in Notes, both launch the apps correctly;
In Safari / Chrome, only the links from the non-www domain launch the app reliably, 100% of the times;
In Safari / Chrome, the www version of our links sometimes launch the app, but always stop working after the first tap;
In Safari, if I longpress a www version of a link, it does show the "Open in App" context option;
I configured our app to handle both our wwww and non-www domains; we use React Native / Expo, so this is what we have under ios.associatedDomains:
"associatedDomains": [
"applinks:www.mydomain.com",
"applinks:mydomain.com"
]
Regarding the AASA, it's located on /.well-known/apple-app-site-association and returns context-type correctly (json):
{
"applinks": {
"apps": [],
"details": [
{
"appIDs": ["MYTEAMID.com.ourcompany.ourfirstapp"],
"components": [
{
"/": "/first-app/path",
"comment": "Matches any URL whose path starts with /first-app/path"
}
]
},
{
"appID": "MYTEAMID.com.ourcompany.ourfirstapp",
"paths": [ "/first-app/path" ]
},
{
"appIDs": ["MYTEAMID.com.ourcompany.oursecondapp"],
"components": [
{
"/": "/second-app",
"comment": "Matches any URL whose path starts with /second-app"
}
]
},
{
"appID": "MYTEAMID.com.ourcompany.oursecondapp",
"paths": [ "/second-app" ]
}
]
},
"activitycontinuation": {
"apps": [
"MYTEAMID.com.ourcompany.ourfirstapp",
"MYTEAMID.com.ourcompany.oursecondapp"
]
}
}
I currently have no idea how to fix the safari/chrome behavior for the www domain links.
Finally found the answer. Quoting from the Branch documentation:
Universal Links will not work with a user-driven
element click on the same domain. For example, if there is a Universal
Link on google.com pointing to a different Universal Link on
google.com, it will not open the app.
In my case, the www links that didn't work were linked from a page I was hosting within the same www domain, so they were not expected to work at all.
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.
All my applications use the same custom domain, namely links.ci--e.es.
My app are:
Co-ba -> Bundle id --> com.cit--e.co-ba
Ca-as -> Bundle id --> com.cit--e.ca-as
Gu-la -> Bundle id --> com.cit--e.gu-la
In each app:
I have installed on my device my applications.
I have correctly set up all my applications. Both live and test dashboard. Also in XCode.
I consider the code for facebook. And I added the code to my Applications.
In Validator universal links, personalized domain, the bundle id and return prefix me this json. And everything is correct.
Validator Universal Links
Validator Universal Links
{
"applinks": {
"apps": [],
"details": [
{
"appID": "ZXXXXXXXX4.com.ci--e.co-ba",
"paths": [
"*",
"/"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.gu-la",
"paths": [
"*",
"/"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.ca-as",
"paths": [
"*",
"/"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.test",
"paths": [
"*",
"/"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.co-ba",
"paths": [
"*",
"/"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.gu-la",
"paths": [
"*",
"/"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.test",
"paths": [
"*",
"/"
]
}
]
}
}
For each of my applications I make marketing link. Example:
App name Co-ba
- htttp://link.ci--e.es/TzUm/CL1D25b4tt
App name Ca-as
- htttp://link.ci--e.es/LKVl/wkb27JqVtt
App name Gu-la
- htttp://link.ci--e.es/lySm/ygacY4N2tt
And these links work correctly when there is a single application installed on my device. Links do not work properly when installed have more than one application.
The links I always open the same application even if they belong to another application. Example:
If you have installed Co-ba and Gu-la. I open a link on my device Co-ba and the Co-ba app opens. I open a link on my device Gu-la and the app opens Co-ba. This is a mistake. Where you can be the fault?
thanks for your reply.
Alex from Branch.io here:
Short version
Branch doesn't currently support multiple apps on the same domain, so there will be some unavoidable unexpected behavior. I recommend using different subdomains for each app.
Longer explanation
The reason this is happening is because all three apps are registered to open the same Universal Links URLs. Co-ba is just the first one in the apple-app-site-association file, so it is the one that opens by default when several apps are installed.
If you look at the Branch link links for each app, you'll see there is a four character unique ID in each one.
Co-ba: TzUm
Ca-as: LKVl
Gu-la: lySm
This four character ID is what Branch uses to separate the links for each app, so that only the correct app opens. You will need to host your own apple-app-site-association file and update it to look like this (also getting rid of the duplicate entries):
{
"applinks": {
"apps": [],
"details": [
{
"appID": "ZXXXXXXXX4.com.ci--e.co-ba",
"paths": [
"/TzUm/*",
"/a/Branch-key-for-co-ba/*"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.gu-la",
"paths": [
"/lySm/*"
"/a/Branch-key-for-gu-la/*"
]
},
{
"appID": "ZXXXXXXXX4.com.ci--e.ca-as",
"paths": [
"/LKVl/*"
"/a/Branch-key-for-ca-as/*"
]
}
]
}
With this solution, you must keep in mind that Marketing links created on the Branch dashboard (and any other link you create with a custom alias) will not work, because they do not have the four character identifier.
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/*",
"/*"
]
}]
}
}