Skip to content

Commit

Permalink
Merge pull request #148 from BranchMetrics/fix/init-session-while-off…
Browse files Browse the repository at this point in the history
…line

[FIX] Fixed NonBranchLinkHandler when app is offline.
  • Loading branch information
aaustin committed May 29, 2016
2 parents 6ce246f + f743662 commit c7b0d8e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/android/io/branch/BranchSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public void onInitFinished(JSONObject referringParams, BranchError error) {
} else {
String errorMessage = error.getMessage();

out = String.format("NonBranchLinkHandler(%s)", error.toString());
out = String.format("NonBranchLinkHandler(\"%s\")", error.toString());
webView.sendJavascript(out);

if (this._callbackContext != null) {
Expand Down
7 changes: 0 additions & 7 deletions testbed/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ function NonBranchLinkHandler(data)
}
}

function NonBranchLinkHandler(data)
{
if (data) {
alert('Non-branch link found: ' + JSON.stringify(data));
}
}

function SetDebug(isEnabled)
{
console.log('Trigger SetDebug()');
Expand Down
7 changes: 7 additions & 0 deletions www/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,11 @@ Branch.prototype.creditHistory = function () {

};

/**
* NonBranchLinkHandler callback placeholder.
*
* @param {String} response
*/
window.NonBranchLinkHandler = (typeof NonBranchLinkHandler === 'undefined') ? function (response) {} : NonBranchLinkHandler;

module.exports = new Branch;

0 comments on commit c7b0d8e

Please sign in to comment.