Start a new topic

BugReport : Back Button on Android/Phonegap

BugReport : Back Button on Android/Phonegap


Hi,

This is to report a problem I'm facing with PhoneGap/Wikitude integration. Basically, the physical android back button cannot be overriden after opening an architect world.

Conditions :

Android in PhoneGap with PluginSample app

Android Nexus S / Android 4.2.2

Steps to reproduce :

- Get the latest version of PluginSample app

- Add the following lines to the assets/www/js/index.js file at line 61 in onDeviceReady function :

        document.addEventListener("backbutton", app.onBackButton, false);
    },
    onBackButton : function(){
        console.log("onBackButton");
    },

This prevent any use of back button and log a line on button push.

- Deploy and launch the app

- Use the back button just after startup, as expected a log is written

- launch an architect world and use it (tap on it)

- use the back button to return to the main menu

- push the back button, app is exited whereas it should not.

 

Interesting behaviour to note : If the architect world is launched but not interacted with (no tap on the view, and only the back button is pushed) the backbutton keeps its expected behaviour.

Thanks for your feedback on this.

Benoit

Hi Benoit!

For technical reason we have to span the AR-View right on top of the PhoneGap view. Back-button is intercepted in native android so avoid timing issues caused by PhoneGap JS-call delays, which may cause unexpected app behavior.

Unfortunately we have to manually focus the user input to the AR-View and give it back to the PhoneGap View. For some reason this behavior is different on Android 4.4 than on Android <KitKat. We are aware of this issue and will handle this in an upcoming plugin version separately. Meanwhile you can customize the backbutton behavior directly in the WikitudePlugin.java file.

Kind regards,
Andreas

This issue still remains.

Everytime i click on the AR-View, back button has issues.

Could you please provide fix for this ?

This issue still remains.

Hi,
Today we released version 5.2 of our SDK including updates to our extension.
The latest Wikitude Cordova plugin now includes a callback which is called once our augmented reality view/plugin closes. Please have a look at our example application on how to set the new back button callback.

Best regards,

Andreas
Login or Signup to post a comment