Pregunta

I'm using wikitude for my mobile app project. My problem is I cant exit world after click back button.

My code

clickedClose: function() {
        document.location = 'architectsdk://actionButton?action=close';
    } 

I'm using code samples from this repo, https://github.com/Wikitude/wikitude-phonegap-samples

TQ

¿Fue útil?

Solución 3

try to swipe from left to right or add a button in the Architect World, calling document.location = 'architectsdk://actionButton?action=close'; as a click action.

Otros consejos

Interaction possibilities are very restricted in terms of "back"-button. For technical reason intercepting this event is not same throughout all Android Versions. As a rule of thumb: Pressing the backbutton on an Android phone will close the AR-View and your're back in your PhoneGap scene. You may define additional actions to this by defining own "backbutton" listener in phoneGap.

In case this does not work for you either I guess you have an Android 4.4 phone in your hands for which we'll soon publish an update to avoid closing the whole app instead of AR-View only.

Technical sidenote: Current implementation of Wikitude PhoneGap plugin spans a fullscreen AR-View right on top of your PhoenGap scene gaining the focus of the app. The backbutton event is intercepted in native Android code to hide & properly destroy the AR scene and returning focus back to your PhoneGap view. Please keep in mind that the AR-Plugin works in another way than e.g. simple SMS Plugins and may cause troubles in case you are using a cam in your launcher-app too.

Kind regards, Andreas

This is how I exist from a world:

  1. In the world's js file I have a exitWorld function:

    exitWorld: function(){ document.location = 'architectsdk://onUrlInvoke'; }

  2. On the main javascript file before app.wikitudePlugin.loadARchitectWorld I set an invoceCallback:

    app.wikitudePlugin.setOnUrlInvokeCallback(app.onUrlInvoke);

  3. And this is the close function:

    onUrlInvoke: function (url) { app.wikitudePlugin.close(); }

This works really good for me. I hope that this will help you. Good luck ;)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top