Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Branch Links are not detected by the plugin #160

Closed
suzon opened this issue Jun 28, 2016 · 5 comments
Closed

Non-Branch Links are not detected by the plugin #160

suzon opened this issue Jun 28, 2016 · 5 comments

Comments

@suzon
Copy link

suzon commented Jun 28, 2016

I’ve implemented NonBranchLinkHandler() like below, which is detected into iPhone/iPad but it is not detected into Android phones/tab. Note: I’m using cordova-ionic-phonegap-branch-deep-linking version: 2.1.6

window.NonBranchLinkHandler = function (data) {
   console.info(data);
   topic.publish('xyz', data);
};

I did not found any exception to show on post!
Community ref → https://mobilegrowth.org/questions/question/non-branch-links-are-not-detected-by-the-plugin/

@aaustin
Copy link
Contributor

aaustin commented Jun 28, 2016

Hey @suzon - That's strange. I swear I fixed this in the latest release. I will investigate first thing tomorrow.

@aaustin
Copy link
Contributor

aaustin commented Jun 28, 2016

@suzon - please review the PR I just made!

@suzon suzon closed this as completed Jun 28, 2016
@suzon
Copy link
Author

suzon commented Jun 28, 2016

@aaustin - yes! this fix is working for me. Thank for quick fixing.

@malua
Copy link

malua commented Jun 29, 2016

Still not working for me.
the string sent from
out = String.format("NonBranchLinkHandler(\"%s\")", message.toString()); has this extra "" around the parameter object
compared to the out = String.format("DeepLinkHandler(%s)", referringParams.toString());.

the javascript eval() method in cordova.js which is executing the output from webView.sendJavascript(out); is throwing an "uncaught syntaxerror: missing ) after argument list"

so the string looks like this:

NonBranchLinkHandler("{"error":"Not a Branch link!","url":"myapp://subsite/86"}")

when i change it in runtime to:

NonBranchLinkHandler({"error":"Not a Branch link!","url":"myapp://subsite/86"})

the eval() method doesnt throw an error and NonBranchLinkHandler gets called properly.

EDIT:
https://github.com/malua/cordova-ionic-phonegap-branch-deep-linking/commit/dfd8c18f9211837aa6862ea92c8117ebcab4c372

This fixes it for me.

@aaustin
Copy link
Contributor

aaustin commented Jul 1, 2016

Thanks for the catch and suggested fix Malua. I'm merging this fellow in: #165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants