Detecting iPhone X swipe up from bottom (DEF-3870)(SOLVED)

Touches get “stuck” when swiping up on an iPhone X in my game. I’m trying to catch it (unsuccesfully) with this code:

local function window_callback(self, event, data)
	if event == window.WINDOW_EVENT_FOCUS_LOST then
		is_touching_screen = false -- Not triggered on iPhone X swipe up
	end
end

window.set_listener( window_callback )

I also use this code:

function on_input(self, action_id, action)

	if action.pressed then
		is_touching_screen = true
	elseif action.released then
		is_touching_screen = false -- Not triggered on iPhone X swipe up
	end

end

Neither seem to fix the problem. Any other options available, or should I wave the unfixable red flag?

Bump!

Hmm, we need to investigate this. @AGulev, maybe we can take a look at this today? This might have to do with touch detection outside of the safe areas of the phone. @sven?

2 Likes

We are working on this issue, no ETA. In our internal tracker, this issue is DEF-3870

3 Likes

Great, thanks! Let me know if I can help test.

1 Like

On our side, we can fix an issue with event “stuck” but you should to implement respecting of Apple guidelines about “safe area” yourself https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/

2 Likes

Thanks, that’s a great link. Is there a way to get the safe areas in Defold? In my game I prevent taps at the bottom, using a value guesstimated by me.

Yes. @sven created this extension a while back: https://github.com/defold/extension-safearea

I afraid this NE iOS only and as I understand @totebo is talking about html5

Nice!

Ah yes, it’s for Facebook Instant. Damn this muddling of platforms!

Ah, yes, true. There’s probably a way to get the safe areas in HTML5. Maybe something like this:

https://www.quirksmode.org/blog/archives/2017/10/safeareainset_v.html

3 Likes

Solved in1.2.150

2 Likes