【问题标题】:Android - `onInitFinished` method is not callled in Branch.ioAndroid - Branch.io 中未调用“onInit Finished”方法
【发布时间】:2018-02-14 12:39:23
【问题描述】:

我是 branch.io 的新手,我正在关注他们的官方文档。当我运行我的应用程序时,onInitFinished 方法未被调用。我发现了相同的问题here,但在解决方案中使用了一个术语postBranchInitSession(null);,这对我来说是未知的,我试图找出但没有得到任何东西。在其官方文档中有非常混乱的文档,从该文档中我没有得到任何东西

这是我的代码:

  try {
        branch = Branch.getInstance();
        branch.initSession(new Branch.BranchReferralInitListener() {
            @Override
            public void onInitFinished(JSONObject referringParams, BranchError error) {
                if (error == null) {
                    Log.d("Splash onStart", referringParams.toString());

                } else {
                    Log.i("MyApp", error.getMessage());
                }
            }
        }, this.getIntent().getData(), this);
    } catch (Exception ex) {

    }

请帮帮我!

【问题讨论】:

    标签: android deep-linking branch.io


    【解决方案1】:

    StackOverFlow 和其他网站上检查了这么多问题和解决方案后,我通过在应用程序中添加android:name="io.branch.referral.BranchApp" 解决了这个问题,如下所示:

    <application
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
         android:name="io.branch.referral.BranchApp">
         ...
    </application>
    

    如建议here by Alex Bauer

    【讨论】:

      猜你喜欢
      • 2021-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多