sendBranchEvent callback is not invoked
See original GitHub issueI’m calling sendBranchEvent
in the same way as the example posted here: https://docs.branch.io/apps/cordova-phonegap-ionic/#track-commerce
However, the promise never resolves on Android (I haven’t tested iOS yet). The issue seems to be that the callback was commented out:
If the callback is not supposed to fire, please update the docs. Actually – the README still uses Branch.sendCommerceEvent
, which is deprecated according to the code (https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/blob/master/src/index.js#L169).
Additionally, I noticed that the parameter checks for this method (and others) look incorrect (https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/blob/master/src/android/io/branch/BranchSDK.java#L148):
// this will never fire! Should be OR rather than AND?
if (args.length() < 1 && args.length() > 2) {
callbackContext.error(String.format("Parameter mismatched. 1-2 is required but %d is given", args.length()));
return false;
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top GitHub Comments
@sequoiaat I can confirm that the callbacks are not invoked when using the
sendBranchEvent
method.When running the Ionic 3 Example App, the code should show an alert after calling the
sendBranchEvent()
method:But the callbacks are not being executed.
Logs show that the events are being sent properly to Branch’s server so the issue seems to be just that the callbacks are not being called.
Logs: logs.txt
@sebaferreras Adding a ticket for this. The iOS and Android apis are fire and forget. We should have just called the JS back with a success as soon as the event queued to native code.