Thanks for the quick reply. This was my first inclination, which does not work.
@JsMethod(namespace = JsPackage.GLOBAL, name = "handleOpenUrl")
public void runMe(String url) {
Window.alert("Success");
}
Perhaps, I am doing it wrong, but I had always thought the JsInterop wraps existing javascript. I am trying to declare a new javascript function in the global namespace so that a cordova plugin can call it. handleOpenUrl does NOT exist, but I am responsible for creating it.
Below js code does work inside my index.html. I need to emulate that is GWT.
function handleOpenURL(url) {
alert("received url: " + url);
}
On Mon, Feb 13, 2017 at 8:41 AM, Juan Pablo Gardella <gardellajuanpablo@gmail.com> wrote:
You can use jsinterop.On Mon, 13 Feb 2017 at 13:24 Paul Mazzuca <paul.j.mazzuca@gmail.com> wrote:--I need to create a javascript function called "handleOpenUrl(url)" that will be called from a Cordova plugin (https://github.com/EddyVerbruggen/Custom-URL- ) for a hand off from a mobile browser. If I create the function inside my index.html, it is called successfully. The challenge is how do I move the execution into my GWT module?scheme My ideas are...1: Somehow create a GWT method that is recognized in the global js namespace as "handleOpenUrl"? I know method names get compiled out, so I am not sure how I would accomplish this.2. Leave the handleOpenUrl inside the index.html, but somehow call a GWT method from that?Any thoughts/ideas would be much appreciated.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com .
To post to this group, send email to google-web-toolkit@googlegroups.com .
Visit this group at https://groups.google.com/group/google-web-toolkit .
For more options, visit https://groups.google.com/d/optout .
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/ .ycAylgf11zo/unsubscribe
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsubscribe@googlegroups.com .
To post to this group, send email to google-web-toolkit@googlegroups.com .
Visit this group at https://groups.google.com/group/google-web-toolkit .
For more options, visit https://groups.google.com/d/optout .
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment