Branch.initSession not returning data in Ionic v1

2019-07-30 23:34发布

问题:

I have installed and configured branch as documented. Everything works fine on Android, but I am not able to make it work on iOS.

Here is what I followed.

Ionic v1 project

  1. Created Branch account and configured everything.
  2. Configured keys, domains etc in config.xml file.
  3. Calling branchInit() on deviceready and resume event.

function branchInit() {
  // Branch initialization
  if (Branch) {
    Branch.initSession(function(data) {
      alert("Branch Data", JSON.stringify(data));
      if (data['+clicked_branch_link']) {
        alert("Yes");
      } else {
        alert("No");
      }
    });
  }
}

I have created a link on branch similar to this.

https://abc.app.link/myurl

Click on the link from notes app.

On Android this seems to work fine. Data is returned and I am getting the Yes alert and I can log the data.

On iOS the data is not being returned. The control is not even entering the Branch.initSession method, and I don't see any alerts.

Any helps will be appreciated.