iOS: Detect if the app was installed from an ad or organic install

1k views Asked by At

I have a process that should be done if the app is downloaded via an ad and not an organic download. Is Their a way to detect if the app was downloaded via an ad? That means the user pressed on a link which redirected the user to the App Store and then download the app. I need the link that redirected the user to the store.

I tried to add some logs in the 3 functions:

  • application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
  • application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool
  • application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool

How I'm testing? I am pressing a link that redirects me to my app in the store, then run the app from Xcode. I'm expecting (in the first open of the app) to receive the url that redirected me in one of these functions. However, the first function is returning nil for launchOptions and the app is not entering the last 2 functions.

I'm I missing something?

0

There are 0 answers