Universal link not working if app is not installed on an iOS Device

自闭症网瘾萝莉.ら 提交于 2020-05-29 05:57:04

问题


I've implemented universal links in my application as well as server side. Everything works fine when the app is installed. If the app is not installed on the device and I click on the universal link from say notes or mail, I'm redirected to the app store from where I can download the app. On download completion however, if I click 'OPEN' in the app store page, the app delegate method below is not called:

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler

As a result, I cannot perform certain actions in response to the userActivity.webpageURL that I would normally get when the app is running or previously installed on a device. Is this normal behaviour? i.e. If the app is not installed, the Universal link will only serve as a medium to install the app from the app store?


回答1:


That's exactly how universal links are supposed to work. If the user didn't have your app, the download is a brand new session instead of a continued user activity.

I believe branch.io offers an SDK that allows for continuity for new installs.

Edit:

Ok, I did some digging and this is called deferred deep linking. It's not officially supported by Apple Universal links.

But here's basically how branch does it:

  • When the new users visits your site, you store a unique token in the cookies for you website.
  • Then when the app is opened for the first time, you check for that token using SafariServices
  • If the token is present, run your continuity code.

Here's a more detailed article about all the linking types in iOS.




回答2:


The only way you can achieve this is through device fingerprinting mechanism. This is how providers like Branch, Adjust, GetSocial, Appsflyer, Tune, Kochava etc perform contextual deeplinking, deferred deeplinking, attribution, and tracking.

If you don't want to use any of the providers mentioned above, and if you just want a very basic device fingerprinting mechanism then you can do so by using only IP address. This is a very nice article from Tune on different methodologies used for attribution.

(Disclaimer: I am the founder of GetSocial)



来源:https://stackoverflow.com/questions/47434221/universal-link-not-working-if-app-is-not-installed-on-an-ios-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!