1

I am new to app development and I cannot figure a way to get the install url from which the app was downloaded/installed (ex: the ad url with the utm parameters) and read it in the app. For example if I open an add and the downloads the app from that ad URL, can I read that URL inside the app when he opens the app? I found the getInstallReferer method but I am not sure is the one I need to use and is only valid for Android. I am using React Native

iGionea
  • 44
  • 5

2 Answers2

2

The search term you're looking for is Deferred Deep Linking. On android it is supported natively as you have said. You can use play-install-referrer-react-native that wraps the native library for you, but this is not cross-platform

It seems like Apple does not support this out of the box the way android does, so you would have to go the route of this answer, or a more robust library like branch which has a react-native package you can try out.

Pieter Buys
  • 1,280
  • 1
  • 10
  • 20
  • 1
    Thanks for the reply. I managed to do it for Android with the mentioned getinstallreferer method. Regarding iOS I am trying right now with Firebase and Dynamic Links. Will update as soon as I have a solution. Dynamic Links are supported by react native firebase library – iGionea Apr 27 '21 at 12:46
0

If by application id, you're referring to package name, you can use the method Context::getPackageName Check out this Link

For example you can start an activity with the taken the package name:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=package_name"

That is the more elegant way. I think your question is answered by now. Cheers :)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Ole Pannier
  • 3,208
  • 9
  • 22
  • 33