android - 错误-Branch IO : Trouble initializing Branch. 无法访问分支服务器,请稍后再试

标签 android deep-linking branch.io deeplink

我正在尝试使用 Branch IO Android SDK,通过引用 branch documentation我创建了一个简单的空白应用程序,并在主 Activity 中实现了 onStart() 方法:

@Override
public void onStart() {
    super.onStart();
    Branch branch = Branch.getInstance();

    branch.initSession(new Branch.BranchReferralInitListener() {
        @Override
        public void onInitFinished(JSONObject referringParams, BranchError error) {
            if (error == null) {
                // params are the deep linked params associated with the link that the user clicked before showing up
                Log.i("BranchConfigTest", "deep link data: " + referringParams.toString());
            } else {
                Log.e("MyApp", error.getMessage());
            }
        }
    }, this.getIntent().getData(), this);
}

通过分支链接打开应用程序后,我在 Android Logcat 上收到此错误:

E/MyApp: Trouble initializing Branch. Unable to reach the Branch servers, please try again shortly.

I/Adreno-EGL: : EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8974_LA.BF.1.1.1.C3__release_AU () OpenGL ES Shader Compiler Version: E031.25.03.06 Build Date: 04/27/15 Mon Local Branch: mybranch9445032 Remote Branch: quic/LA.BF.1.1.1.c3_1 Local Patches: NONE Reconstruct Branch: NOTHING

最佳答案

来自 Branch 的 Alex:如果您的应用没有 INTERNET,我们通常会看到此错误。配置的权限(有关 Android 开发者门户的更多信息,请参阅 here)。

尝试设置<uses-permission android:name="android.permission.INTERNET" />在您的 AndroidManifest.xml 中,此错误应该会消失。请参阅here了解如何在我们的演示应用程序中进行设置。

关于android - 错误-Branch IO : Trouble initializing Branch. 无法访问分支服务器,请稍后再试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36068052/

相关文章:

android - flutter 错误 : SafetyNet Attestation fails basic integrity

swift - Swift 中标签词选择的动态弹出窗口

Android URI 方案与应用链接

ios - Branch io iOS 链接总是重定向到 App Store 而不是我们的应用程序

ios - 如何将两个branch.io深度链接与单个应用程序集成

javascript - Android - Google MAP API 和内部 GPS 支持

AndroidManifest.xml 中的 Android 兼容性设置

ios - 如何在我的iOS Xing App中深度链接到个人资料?

android - 将 branch.io sdk 与 android 应用程序集成,获取 classcastexception

java - android无法接收从pc发送的所有数据