I am trying to use Branch IO Android SDK, by referencing the branch documentation I created a simple blank application and implemented the onStart() method in the Main Activity:
@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);
}
After the application has been opened by the branch link, I received this error on the 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
Alex from Branch here: we usually see this error if your app doesn't have the INTERNET permission configured (see here for more on the Android developer portal).
Try setting <uses-permission android:name="android.permission.INTERNET" /> in your AndroidManifest.xml and this error should clear up. See here for how it's set up in our demo app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With