swipe near the bottom of the screen can accidentally activate the IOS Control Center

Hi,

I am developing an app where the player swipes objects from the bottom of the screen in portrait mode, to hit objects coming down, shoot 'em up style.

The only issue is that in testing on an iPhone device, the control center is frequently ‘pulled up’ by mistake.

I notice in other full-screen commercial games (like clash of clans), the control center is much harder to pull up.  Instead, an arrow is shown, and the user must specifically swipe that.

Is there a way to force this behavior in Corona SDK?

For reference, the issue was also noted in this thread, but without an answer :

https://forums.coronalabs.com/topic/36035-ios7-testing/

Thanks,

Matt

Engineering will be adding a new native.setProperty() called preferredScreenEdgesDeferringSystemGestures that will make you have to swipe twice to activate it.

Watch for it in an upcoming daily build.

Rob

Only apple could come up with a property name that is not only longer than War and Peace, but completely fails to describe what it does. :smiley:

Greatly appreciate the update, thank you.  

How is it that other commercial apps have this already?  i.e. Clash of Clans?

Thanks,

Matt

Maybe they are native coding, thus get any feature that is in the Apple Docs they want as soon as it is documented?

Also, I don’t think the feature is so new that they haven’t had plenty of time to notice the interface change and find the fix for it.

COC likely has dozens of play testers that would have noticed this odd swipe issue as soon as it was added to iOS.  Then, the teams many (many) programmers would have been on the case, looking for the cause and solution.  

The Corona team is much smaller and has to focus on a wider range of features and target devices, so missing a feature like this is no surprise and not a big deal. 

The important takeaway is, the community noticed it and the Corona team responded with a fix.

PS - regarding the unanswered thread… The preferred way to get a new feature is to file a bug or a request via the feature request mechanism.  That said, sometimes new features will come out of forums discussions. 

Good answer @roaminggamer!

Rob

Great answer, I agree, thanks @roaminggamer, and all who responded, appreciate the support!

I see know that this has been implemented in daily builds,  “preferredScreenEdgesDeferringSystemGestures”.

Is there any documentation on how to use this?

Thanks,

Matt

Hi this was also talked about here: 

https://forums.coronalabs.com/topic/71426-preferredscreenedgesdeferringsystemgestures/

If the question is, “How do I enable this?” 

I think the answer you are looking for is,

native.setProperty( "preferredScreenEdgesDeferringSystemGestures", true)

https://docs.coronalabs.com/api/library/native/setProperty.html

I think the docs are a little behind on this one.

Thanks, I will try this asap…

Matt

do I put this in config.lua or in the actual lua file where the game play exists?

Thank you in advance!

Matt

No, you do not put that in config.lua.

You do it in in main.lua or any other script you use for initializing your game logic if you prefer.

I added the code to main.lua and the behavior of the swipe has not been changed.  Meaning, I still have the same swipe behavior, one swipe from the bottom of the screen in portrait easily brings up the control center.

Am I missing something here?

here is the code I added:

native.setProperty( “preferredScreenEdgesDeferringSystemGestures”, true ) – disables single swipe up for control center in IOS

Thanks,

Matt

I just added this to an app and it’s working as expected. I copy/pasted the exact code above.

On first swipe up or down, I get an arrow displayed and then I have to swipe a second time on the arrow. I tested on an iPhone 6 running iOS 11.2.2.

I’m using Corona build 3195.

Rob

Hi Rob,

My rookie mistake, I was using the incorrect build for my test.  I can confirm it does indeed work as described, awesome, many thanks to the team for providing this!

Regards,

Matt

Just a note here - this does not work in conjunction with “prefersHomeIndicatorAutoHidden”

Engineering will be adding a new native.setProperty() called preferredScreenEdgesDeferringSystemGestures that will make you have to swipe twice to activate it.

Watch for it in an upcoming daily build.

Rob

Only apple could come up with a property name that is not only longer than War and Peace, but completely fails to describe what it does. :smiley:

Greatly appreciate the update, thank you.  

How is it that other commercial apps have this already?  i.e. Clash of Clans?

Thanks,

Matt

Maybe they are native coding, thus get any feature that is in the Apple Docs they want as soon as it is documented?

Also, I don’t think the feature is so new that they haven’t had plenty of time to notice the interface change and find the fix for it.

COC likely has dozens of play testers that would have noticed this odd swipe issue as soon as it was added to iOS.  Then, the teams many (many) programmers would have been on the case, looking for the cause and solution.  

The Corona team is much smaller and has to focus on a wider range of features and target devices, so missing a feature like this is no surprise and not a big deal. 

The important takeaway is, the community noticed it and the Corona team responded with a fix.

PS - regarding the unanswered thread… The preferred way to get a new feature is to file a bug or a request via the feature request mechanism.  That said, sometimes new features will come out of forums discussions.