iosios9http-refererrefererreferrerurl

Get referrer string for Universal Link?


I implemented Universal Links in our iOS 9 app and they work by calling a method in AppDelegate.swift, in which I get an NSUserActvity with an URL attached to it.

Is there a way to get the (HTTP-) referer? I need to know on which website the user has tapped the link that opened the app.


Solution

  • You should be able to use NSUserActivity > referrerURL instance property. See https://developer.apple.com/documentation/foundation/nsuseractivity/2875762-referrerurl.