简体   繁体   中英

Universal Links not working and banner is not showing in Safari

I am working on Universal Links in my app.

When the url hits the safari it should show the option to open the app in a banner at the top of the Safari browser, but I don't see it.

I created apple-app-site-association and hosted it on my backend. When I check it https://www.xxxxx.com/apple-app-site-association . I can see the app-site-association file.

In the Entitlements I've added associated domains under items applinks:v100.xxxxxx.com/reset_password*. The link is https://v100.xxxxxxx.com/reset_password?token=6d3ec67ff5bbf2214c895839c125e8f80ec83a90 and the apple-app-site-association is like this

{
 "applinks": {
 "apps": [],
 "details": [
 {
  "appID": "Teamid.Bundelid",
  "paths": ["*"]
 }
{
"appID": "appid.Bundelid",
"paths": ["*"]
}
]
}
}

Thanks for quick response.

This banner should show up if Universal Links are configured properly. It seems like your Universal Linking is not configured.

Your entitlement's associated domains has a LINK, not a DOMAIN

At first glance, it looks like your entitlements file has the full URL when it really should just have the domain. Change your entitlements to have applinks:v100.xxxxxx.com instead of applinks:v100.xxxxxx.com/reset_password* . If that doesn't do the trick, then keep reading

Still broken? Try these steps

It looks like your AASA file is hosted correctly, so I recommend trying these steps:

1) Make sure that your entitlements file is included in your project. This is necessary for downloading the AASA. Ensure that your domains are correct.

应用权利

2) Check if your phone is running iOS 11.2. This version of iOS is having trouble actually downloading the AASA file sometimes. To solve this you should delete the app, restart your phone, then reinstall it. I recommend checking the device logs to see whether it is being installed properly. (I'd recommend doing this when you update your AASA just for sanity)

3) Check to see whether you have disabled Universal Links in your app (probably not your issue but check). You can do this by copying the link into the Notes app then long pressing on it to prompt an action sheet. If you see "Open in App name" then you can select that to turn on your Universal Links for that app. If you don't see that then the AASA file was not downloaded or configured properly.

4) Use Branch's iOS SDK for deep linking. It will save you SO MANY HOURS of debugging. They handle the AASA file for you as well as providing the deferred deep linking solution and other edge cases.

To prompt browser user with a banner for iOS app you have to add this line to the HTML, there are no Universal Links included in this.

 <meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL"> 

When implementing Universal Links you are taking care of that users doesn't even reach the Safari browser, but to be taken directly to your app. Configuration for the Universal Links seems fine. Make sure you remove your app from the device and install it again every time you make changes to any Universal Link configuration. If you want to read more about it I recommend these links

https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html

https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html

https://medium.com/@abhimuralidharan/universal-links-in-ios-79c4ee038272

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM