React Native branch.io iOS getFirstReferringParams() object empty on app installation

185 views Asked by At

I am developing a React Native mobile app and I want to use branch for a referral feature. On android everything seems to work but on iOS I have the following problem:

Whenever a user clicks on the link shared via the share sheet by the other user (the referer) the user will be forwarded to the App Store in iOS to download the app.

Now, because I do not have the app in production:

  1. I open the link on the device I have the TestFlight App installed
  2. Then it leads me to the App Store.
  3. Then I close the App Store and download the app via the TestFlight app.
  4. Then when the I sign up in the app, I call the getFirstReferringParams() function from the react-native-branch package in order to receive the params I attached in the BUO (https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/blob/master/src/index.d.ts#L220).

This works on Android, but it does not work on iOS. The object I retrieve from getFirstReferringParams() is empty.

The links are correct, and the integration of branch is correct since the params can be retrieved when I click the link and the app is installed. But whenever it is not installed, it is not working on iOS.

Now on Stackoverflow, some Branch Support people write, we should try it with https://www.diawi.com to simulate the install, but this is also not working.

So is this because the app is not installed directly from the App Store when I am not in production and this is the reason why the params are empty? Will it work when I submit the app to the App Store? Or do I have something wrong in my code?

I am happy to update this question with any information or code needed.

EDIT: Found the problem. I had a configuration issue. I forgot to add the following to the info.plist file: (With the right values from the branch.io dashboard.

<key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleTypeRole</key>
                <string>Editor</string>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>branchsters</string>
                </array>
                <key>CFBundleURLName</key>
                <string>io.Branch.Branchsters</string>
            </dict>

Now it works like expected. So branch works without the need to have the app in the App Store. Just make sure to follow the documentation right.

0

There are 0 answers