Start a new topic

Passing parameter to phonegap

Passing parameter to phonegap


Hi there!

Just call WikitudePlugin.setOnUrlInvokeCallback and pass over a function. You can then create a button that calls "document.location=architectsdk://foo?bar=1" and get notified in your function.
Although I don't have a phonegap sample in place, the current AndroidSDK sample app demoes the concept too.


Andreas, it would be very useful to see an example as Sebastian required. I am having a similar issue.



Hi Andreas,


Could you post a basic sample of an implementation for this 'listener' and explain us where we have to include it? I'm dealing with a very similar issue and would appreciate your help.

Thanks in advance!



Hi again,

Please have a look at the PhoneGap plugin implementation and its documentation.
You need to register a listener to handle calls of "document.location = "architectdk://foo?bar=123", use setOnUrlInvokeCallback

for this purpose.

That way you can interact between Wikitude and PhoneGap context.
You may even use callJavaScript to interact between PhoneGap and Wikitude context.

Kind regards,

Hi Andreas,

Indeed I could not fetch this at phonegap side. is 'recognized'  a html file (if it is when I close AR view I am seeing www/index.html phonegap main page) or a js function at www/js/index.js?

Thank you. 

Hi there!

I recommend you to define a onEnterFieldOfVision trigger and call e.g. document.location ='architectsdk://recognized?target=1'.
You can then fetch this event in your phoneGap environment and close AR view.

Hope that heps,
Kind regards,
Hi, is there a way to return a parameter when World view closed with
document.location ='architectsdk://actionButton?action=close'?

In example, when I track an object I am estimating that user should close the AR view and return to the phonegap page. At that stage I should change value of an input.

Login or Signup to post a comment