Skip to content

Commit

Permalink
fix: removed DeepLinkHandler for callback
Browse files Browse the repository at this point in the history
BREAKING CHANGE: deep link data must be read from the Branch.initSession().then(data => {}) promise. See https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking#migrating-branch-cordova-sdk-from-v25-to-v30
  • Loading branch information
ethanneff committed May 7, 2018
1 parent b8304e6 commit c9c1543
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ _Questions? [Contact us](https://support.branch.io/support/tickets/new)_

* #### Compiling: Errors

* ##### Migrating Branch Cordova SDK from v2.5+ to v2.7+
* ##### Migrating Branch Cordova SDK from v2.5+ to v3.0+

```diff
// Branch initialization
Expand Down
6 changes: 0 additions & 6 deletions src/android/io/branch/BranchSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -830,22 +830,16 @@ public void onInitFinished(JSONObject referringParams, BranchError error) {
String out;

if (error == null && referringParams != null) {

out = String.format("DeepLinkHandler(%s)", referringParams.toString());
sendJavascript(out);

if (this._callbackContext != null) {
this._callbackContext.success(referringParams);
}

} else {
JSONObject message = new JSONObject();
try {
message.put("error", error.getMessage());
} catch (JSONException e) {
e.printStackTrace();
}

if (this._callbackContext != null) {
this._callbackContext.error(message);
}
Expand Down
3 changes: 0 additions & 3 deletions src/ios/BranchSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ - (void)initSession:(CDVInvokedUrlCommand*)command
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:resultString];
}

// assigns data to DeepLinkHandler within branch.js
[self.commandDelegate evalJs:[NSString stringWithFormat:@"DeepLinkHandler(%@)", resultString]];

if (command != nil) {
[self.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
}
Expand Down

0 comments on commit c9c1543

Please sign in to comment.