1

I am trying to use Branch in my Cordova Android app. Everything works fine in android versions above 4.4.2 But, in all versions below android 4.4.4 , Branch does not work.

I have done

function onDeviceReady() {
    console.log(Branch);
    Branch.initSession().then(function (res) {
       alert('something);
    }).catch(function (err) {
        alert('errref:'+err)
    });

    alert('outer alert');

}

It prints an object on console, as expected. and nothing else happen on versions below 4.4.4 While on 4.4.4+ , it gives an alert "something" and "outer alert"

programmer
  • 304
  • 8
  • 22

1 Answers1

0

Since Android 4.4.4 (KitKat) permission model changed dramatically. Try adding permissions manually:

Add the following entry to your application's config.xml:

<branch-config>
    <android-prefix value="READ_FROM_DASHBOARD" />
    <host name="bnc.lt" scheme="https" />
</branch-config>

There are a lot of good docs here - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK

Samvel Avanesov
  • 412
  • 2
  • 7