简体   繁体   English

Play商店安装后,React本机android应用未获取分支引用数据

[英]React native android app not getting branch referral data after play store install

We have a react native app, compiled into both android and ios. 我们有一个React Native应用程序,已编译为android和ios。 We are using branch.io to track installs via different links and route the user to different places. 我们正在使用branch.io通过不同的链接跟踪安装,并将用户路由到不同的地方。 The ios app works great in all scnearios. ios应用程序可在所有场景中正常运行。

For the android app, it works in every test case listed on the site (most of which are install the app but don't open it, then click the link, or vice versa), but when the link directs the user to the play store, and they download it from there, the link is not working. 对于android应用程序,它可以在网站上列出的每个测试用例中使用(大多数情况下都安装了该应用程序,但未打开它,然后单击链接,反之亦然),但是当链接将用户定向到播放时商店,然后他们从那里下载该链接,则该链接无法正常工作。

I have seen 3 cases 1. It works fine (rare) 2. It doesn't work at all, and no data comes through 3. Params come through as +clicked_branch_link:false +is_first_session:true 我见过3种情况1.正常工作(很少)2.根本不工作,没有数据通过3.参数通过+clicked_branch_link:false +is_first_session:true

I am using the latest version of react-native-branch from npm 我正在使用npm的最新版本的react-native-branch

So far, email support from branch has been unresponsive, and the one response I received was of no help 到目前为止,来自分支机构的电子邮件支持一直没有响应,我收到的一个回复没有帮助。

In order for all deep linking edge cases to work, you need to confirm that: 为了使所有深层链接边缘案例都能正常工作,您需要确认:

1) You import the Branch packages into your MainApplication.java 1)您将Branch包导入到MainApplication.java

import io.branch.rnbranch.RNBranchPackage;
import io.branch.referral.Branch;

2) Add RNBranchPackage to the package list in MainApplication.java 2)添加RNBranchPackage在软件包列表MainApplication.java

@Override
  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new RNBranchPackage(), // <-- add this

3) Override onCreate() in MainApplication.java 3)在MainApplication.java重写onCreate()

@Override
public void onCreate() {
  super.onCreate();
  Branch.getAutoInstance(this);
}

4) Import Branch into your MainActivity : 4)将Branch导入到您的MainActivity

import io.branch.rnbranch.*;
import android.content.Intent;

5) Branch is initialized in the onStart() of your MainActivity : 5)在您的MainActivityonStart()中初始化分支:

protected void onStart() {
          super.onStart();
          RNBranchModule.initSession(getIntent().getData(), this);
      }

6) onNewIntent() is overidden in the MainActivity : 6) onNewIntent()MainActivity被覆盖:

@Override
      public void onNewIntent(Intent intent) {
          setIntent(intent);
      }

Note that this is under the assumption your MainActivity is the main launcher activity. 请注意,这是基于您的MainActivity是主要启动器活动的假设。 Please reference: https://docs.branch.io/pages/apps/react-native/#android_1 请参考: https : //docs.branch.io/pages/apps/react-native/#android_1

For reference, I was using react-native-branch v2.2.4 from NPM 作为参考,我使用了NPM的react-native-branch v2.2.4

I tested the following cases: 我测试了以下情况:

  1. [Works] Click the branch link then install the app [Works]单击分支链接,然后安装应用程序

  2. [Works] Install the app from an APK but don't open it, then click the link [Works]从APK安装应用程序,但不打开它,然后单击链接

  3. [Works] Install the app from the store THEN click the link [Works]从商店安装应用程序,然后单击链接
  4. [Broken] Click the link to install through the app store [Broken]单击链接以通过App Store安装

Turns out, the issue was resolved by removing the following lines from the AndroidManifest.xml 原来,通过从AndroidManifest.xml中删除以下几行来解决了该问题

        <!-- Branch install referrer tracking (optional) -->
    <receiver android:name="io.branch.referral.InstallListener" android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从应用商店安装android应用后无法获取引荐代码 - Unable to fetch referral code after install android app from app store Android React Native App HostNameVerifier 来自 Google Play 商店的错误 - Android React Native App HostNameVerifier Error from Google Play Store React Native App Play Store JavascriptException - React Native App Play Store JavascriptException 在 Android 和 Apple Store 上为 React Native 部署更改应用程序 Flutter 后? - After deploy change app Flutter for React Native on Android and Apple Store? 从我们自己的服务器(而非Play商店)分发的Android应用的引荐/邀请跟踪 - Referral/Invite Tracking for Android app distributed from our own server instead of Play Store Android App A想要跟踪Android App B安装的Google Play引荐数据 - Android App A wants to track Google Play referral data for Android App B installation 使用React-Native AsyncStorage在App Store / Google Play中通过应用程序更新存储数据 - Storing data through app updates in App Store/Google Play with React-Native AsyncStorage 应用程序在 android - React-native 中启动后立即崩溃 - App getting crash immediately after launch in android - React-native 在Google Play商店上载APK后,React本机应用程序崩溃,这仅是第一次崩溃 - React native app crashes after uploading the apk on google play store, it crashes only for the first time Branch io - 通过 Play 商店安装应用后没有参考参数 - Branch io - No referringParams after app is installed via play store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM