I am trying to implement deep-links via branch.io for an iOS app (Swift 4.2). I have integrated the iOS SDK exactly as outlined in the branch docs. To test the integration, I ran the branch.io universal link validation script and it passed successfully.
What's not working for Universal Links:
Clicking on a deeplink from 'Notes' or 'Messages' does open the app, but no data is passed. Branch reports a completely blank url (example.app.link?%24identity_id=611647344982868361) instead of (example.app.link/hj86HlvvMk2?%24identity_id=611647344982868361), when looking at the debug logs. This is the same as just opening the app manually without a deeplink. No data is available via the deferred deeplink functionality either.
Using URI schemes instead of Universal Links: If I turn Universal Links OFF via the branch.io link settings dashboard, then all urls open in the browser, without any prompt to open the app. However, when I open the app manually, the deeplink data is available on start (via the deferred link functionality).
Other attempts: Adding $uri_redirect_mode: 2 to the link data to force the app open didn't really change anything. The only thing different is that for URI schemes, it displays an error in Safari before redirecting to the $fallback_url. I also tried re-installing the app fresh, clearing Safari cache and cookies, with no success.
I'll also mention that there should be nothing wrong with the deeplinks themselves. On Android, the same deeplinks work perfectly.
Neither method is able to open the app with the deeplink data immediately available. Are there any other options to make this work?
UPDATE: The URI and universal links were separate issues. We got URI to work by double checking our URI scheme (it was incorrect). For universal links, there might be a slight error in Branch's documentation for Swift 4.2. See my answer for a solution.
UPDATE 2019-02-05: Branch documentation has been updated for Swift 4.2. Everything is working nicely.