Start a new topic
Solved

How to disable swipe exit in iOS from AR World?

How to disable swipe exit in iOS from AR World?

1 person has this problem


Hello,

We have observed this only in iOS that after Launching the AR World, you can swipe it right to close the App and it goes to the Home Page (specific to us). We would like to know that if this feature can be controlled in iOS, to stop the exit of AR World on swipe to right.

Kindly Guide and Advise. Thanks.

@Behdad.


I did not see anything regarding this problem in the new sdk. 


However, the fix I provided above still works. These are the changes you should make (2 screenshots below) :


image

 

image

Edit on my last message : the first screenshot is to prevent default back-button behavior on Android. For swipe-back gesture on iOS, just consider the second screenshot. 



Hi Huy,



you do have access to the native files of the Wikitude Cordova plugin; so you should be able to change the behaviour an way you see fit.



- Daniel

Hey everyone,
Now, swipe left to close is handled on native code.

How to add Exit button on AR View.? click on that button, will close AR View.

Please advice,

Thanks


Hi Andreas,

The solution you provided does not seem to be effective anymore. Is there a new way to prevent this "swipe to exit" gesture ?

Thanks :-)

Hi again,

I finally found a solution =D

I commented the following lines on WTARViewController.m file : 

- lines 90 to 93
- lines 229 to 233

I modified the two versions of the files :

- MyApp/platforms/ios/Museopic/Plugins/com.wikitude.phonegap.WikitudePlugin/WTARViewController.m
- MyApp/plugins/com.wikitude.phonegap.WikitudePlugin/src/ios/WTARViewController.m

Then I closed XCode, rebuild with COrdova CLI, relaunch XCode, and build from XCode.

NB : I did that with the version 5.2.0 of the Wikitude Plugin.

 

PS : IMHO it would be nice to be able to have an option in the config.xml (of the cordova project) to deactivate this default behavior. 

Hi Udit,
Sorry for our late response, hopefully you still appreciate the answer.

We have written an article in our Knowledge Base about this. The swipe behaviour is implemented in our plugin but of course you can trigger the same functionality programatically.

Best regards

Andreas

Hi Andreas,

Thanks for getting back. We have already implemente the exit method based on the article you have provide. But my Question is different, apparently this issue is observed in Iphone 5 series, where you can swipe to right to exit. Although is a good feature, but for some reasons we want to stop it from happening. 

Kindly point us to the right direction, we really appreciate your help and support. Thanks.

- Udit

Sorry that I got you wrong.
To disable the gesture recognizer you have to remove line 86 to 89 in WTARViewController.m. You can find this file in the Wikitude Plugin. After you have removed the lines mentioned, simply rebuild your project and you should be fine.

Are you using the Xcode project to start your application or a phonegap/cordova command?

Best regards

Andreas

Hi Amaury,
Thx for the update. After two years, chances are hight that code lines references do not match anymore.

I wrote an internal ticket that we include some kind of configuration in the future. 

Best regards,

Andreas

Thanks alot Andreas. I can see the code, tomorrow I will try it out. Thanks again for your help and support.

PS: we are using xcode.

thx for the information - removing the mentioned lines should then be suffiecient and the changes will be applied once you rerun the application.

Best regards

Andreas
Login or Signup to post a comment