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.
Thanks.
A
Andreas Fötschl
said
about 10 years ago
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, Andreas
o
oguzhan aydin
said
about 10 years ago
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.
A
Andreas Fötschl
said
about 10 years ago
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, Andreas
S
Sebastián Gesualdo
said
about 10 years ago
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!
Sebastián
J
Javier Scher
said
about 10 years ago
Andreas, it would be very useful to see an example as Sebastian required. I am having a similar issue.
Thanks,
Javier
A
Andreas Fötschl
said
about 10 years ago
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.
oguzhan aydin