diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 8043795e..0d2cfbac 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -693,11 +693,11 @@ public void onInitFinished(JSONObject referringParams, BranchError error) { message.put("error", "Not a Branch link!"); message.put("url", deepLinkUrl); - deepLinkUrl = null; out = String.format("NonBranchLinkHandler(%s)", message.toString()); webView.sendJavascript(out); } + deepLinkUrl = null; } catch (JSONException e) { e.printStackTrace(); } diff --git a/src/ios/BranchSDK.m b/src/ios/BranchSDK.m index 687a56bf..6dc761ce 100644 --- a/src/ios/BranchSDK.m +++ b/src/ios/BranchSDK.m @@ -134,9 +134,9 @@ - (void)initSession:(CDVInvokedUrlCommand*)command } else if (self.deepLinkUrl) { [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:@"BSDKPostUnhandledURL" object:self.deepLinkUrl]]; - self.deepLinkUrl = nil; } - + self.deepLinkUrl = nil; + if (command != nil) { [self.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId]; }