Hi I know this question being asked before still I cannot figure out what am doing wrong.
- Added apple-app-site-association file in our server under https://ourserver.com/.well-known/apple-app-site-association
- The file content is as follows
`
{
"applinks":{
"apps":[],
"details":[
{
"appID":"<teamId>.<bundleId>",
"paths":[ "*", "/" ]
}
]
}
}
` 3. Associated Domain is added as capability with
applinks:servername.com
applinks:dev.servername.com
Added code in AppDeletegate.m
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { return [RCTLinkingManager application:application openURL:url options:options]; } - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; }
EDIT 1
Noticed something i tried universal linking in iOS versions 12.4.2 iPhone and it redirected correctly. Where as in iOS version 14 it redirected to our web page. So I updated my apple-app-site-association file as follows
{
"applinks": {
"details": [
{
"appIDs": [
"teamid.bundleid"
],
"components": [
{
"/": "/*",
"comment": "Matches any URL whose path starts with URL_PATH and instructs the system not to open it as a universal link"
},
{
"/": "*",
"comment": "Matches any URL whose path starts with URL_PATH and instructs the system not to open it as a universal link"
}
],
"paths": [
"*",
"/"
]
}
]
}
}
oru web url is validated in this link
All the testing is done in real devices.
EDIT 2
All below is tested in Simulator - iPhone 11 Pro iOS 14.4
Tested the same in a simulator with developer mode
applinks:servername.com?mode=developer applinks:dev.servername.com?mode=developer
it opened correctly in SIMUALTOR
then i misspelled our server name and clicked from iMessages it redirected to Safari in SIMULATOR -
I tried again with correct server name after clearing Safari history and cache - STILL IT REDIRECTES TO BROWSER NOT APP
EDIT 3
On Simulator
Went through this link and saw about Smart App banner since i couldn't find anything like that. After searching found this SO Post and tried Settings - Safari - Advanced - Website Data - In the page showed my domain name - Clear Website Data. Tried again on Simulator and app opened correctly
On iPhone with release adhoc build
On Real Device did the same Settings - Safari - Advanced - Website Data - In the page showed my domain name - Clear Website Data but it didn't work. Still it opens the browser in app
EDIT 4
the AASA file in EDIT 2 make the redirection fail in iOS version 12.4.2. Hence updated it like this
{
"applinks":{
"apps":[
],
"details":[
{
"appID":"teamid.bundleid",
"paths":[
"*",
"/"
],
"appIDs":[
"teamed.bundleid"
],
"components":[
{
"/":"/*"
},
{
"/":"*"
}
]
}
]
}
}
After updating to this redirects to app in version 12.4.2 but fails in 14 and above versions. Modified AASA file after going through this link
Any Help is Appreciated
Thanks in advance
Try replacing "appID":".bundleid" with "appID":".bundleid" in your aasa file.