Closed tlhunter closed 2 years ago
Hello tlhunter, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will investigate the issue and help solve it ASAP. Other community members may also look into the issue and provide feedback 🙌
After reading the Universal Links documentation a few more times, I realized the file needs to be served with Content-Type: application/json
. This isn't the default case on any server since such detection usually depends on file extension. I went and updated the header. Apple takes up to 48 hours to update its cache so it will take a couple days to confirm if this changes anything.
For the curious, to update the header for a PWA hosted on Netlify, add this to a file named netlify.toml:
[[headers]]
for = "/.well-known/apple-app-site-association"
[headers.values]
Content-Type = "application/json"
Apple also offers a webpage for verifying some of this stuff: App Search API Validation Tool. When attempting to check my domain the final bit fails:
Link to Application
Action required Could not extract required information for Universal Links. Learn how to implement the recommended Universal Links.
Error no apps with domain entitlements. The entitlement data used to verify deep link dual authentication is from the current released version of your app. This data may take 48 hours to update.
I think this is the smoking gun that there's an issue with the server configuration. Hopefully, within 48 hours, the caches will update and this will work. Once that's done I'll close out this ticket and maybe this issue will serve as a form of documentation.
After further research, I do suspect the header change don't actually affect universal links. I'm seeing that other services don't necessarily follow the content type guidelines:
content-type: text/plain; charset=UTF-8
(incorrect)content-type: application/json
(correct)It looks like I generated the app via PWA Builder before this commit had landed... https://github.com/pwa-builder/pwabuilder-ios/commit/bce0d1fd0e4f275853a5c0821a6b2244405f2cde
Ah, that was the problem. The code I was using was from an old version of PWA Builder. I generated the app again and copied the newer SceneDelegate.swift file over the older one. Universal links now seem to work.
Describe the bug When a link to the domain that is associated with my PWA is opened, iOS does switch focus to my app. However, the app doesn't load the URL that was opened. Instead, it remains on the screen that was last opened in the app. I believe the Swift app delegate function isn't being called.
URL to app
To Reproduce
Expected behavior
Screenshots The associated domain is configured:
Additional info (please complete the following information):
Additional context
https://app.radar.chat/#/channel/earthquakes
.While debugging, I updated
AppDelegate.swift
to print when a handoff happens. In the simulator, clicking links to the app does switch to the app, but again, the URL isn't received AND the print calls aren't made: