2

Let's say I have a news iOS app with universal link support, and I need to know, for my stats, from where that interaction originates. If I were on the web I could know if the user came from e.g. Google, Facebook or any other website.

Is there a way to know which app brought the traffic to mine, each time it is not opened directly by the user? E.g. if I clicked on a link in Facebook, and user has my app installed on his iPhone, the my app will get called instead of Safari : is there for me a way to know that Facebook is the source of that traffic?

I know of referrerURL available since iOS 11, but it is not quite the same — actually, we would like to know what is the originating app precisely for those cases where referrerURL is nil.

Thanks

KPM
  • 10,558
  • 3
  • 45
  • 66

1 Answers1

0

I didn't test it actually but you should be able to listen to:

class let didFinishLaunchingNotification: NSNotification.Name

notification and inspect the userInfo dictionary to find sourceApplication.

Reference

Fabio Felici
  • 2,841
  • 15
  • 21
  • But this will only get called when app is actually launched, not when it simply became active, right? Plus, according to the documentation, the sourceApplication is nil unless the other app belongs to the same team... – KPM Nov 27 '20 at 18:44