React Native : how to test deeplinking mechanics locally?

251 views Asked by At

I'm using React Native 0.65 and I'd like to setup a referrer reward system following these steps :

  1. Generate a deeplink that redirects to my debug app running locally. In my case with Appsflyer, the link should contain a referrer's ID as parameter.
  2. Clicking the link and opening the debug app with additional parameters
  3. When app is opened, retrieve the referrer's ID from additional parameters

If step 1 looks pretty straightforward, I still can't figure out how to get a link to my debug app and test my referral system. I'm only able to generate a link to my production app, where I can't debug.

Boilerplate for deeplinking is setup, I already managed to use deeplink in my production app.

Documentation for referrer link is there : https://dev.appsflyer.com/hc/docs/rn_userinvite

Can someone show me the way to debug deeplinking locally ?

1

There are 1 answers

0
Mlikaon On

Found out the main part of the solution was related to my android's manifest (while debuging on Android device).

To use a deeplink pointing to a local debug app named myApp, add an intent-filter with a specific scheme :

<intent-filter>  
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myApp" />
</intent-filter>

Then using the uri-scheme package, we can deeplink to our app using the following command :

npx uri-scheme open "myApp://your_specific_path" --android

I didn't try with Appsflyer yet, but that's another story