Start a new topic

Problems with custom close button/mechanism in AR View


I have a problem in my Cordova/Wikitude application where I try to add a custom button to the AR View to give the user the possibility to close the AR View.

Additionally in the Main Cordova Application I use the the Cordova backbutton event as described here to handle the android backbutton in a custom way.

When the custom close button in the AR View is clicked I set the document.location to "architectsdk://someString" to trigger the "onUrlInvoke" callback where I call the close method of the Wikitide plugin.

So far everything works fine ...

But when I now tab the back button in my app the complete app closes immediately. The callback for the Cordova Backbutton event is not triggered.

I assume that this somehow is related to my custom close functionality in the AR View because when I tab the backbutton in the AR view instead of the custom button, the Ar view closes gracefully and the Cordova Backbutton callback is present.

Can you give me any hint or help with this problem?

Best regards,

Oliver Manthey

- Softwareentwickler -

Stiftung Haus der Geschichte der Bundesrepublik Deutschland
Willy-Brandt-Allee 14

D-53113 Bonn

1 Comment

Hi Oliver,

The backbutton event listener is set by WikitudePlugin.loadARchitectWorld and removed by WikitudePlugin.close. It seems like the WikitudePlugin changes the backbutton event listener you are setting. 

If there is an existing ARchitectWorld loaded(between loadARchitectWorld and close) you can also use WikitudePlugin.setBackButtonCallback. 

After WikitudePlugin.close you will have to set your backbutton event listener again.

Best Regards,


Login or Signup to post a comment