4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.82k stars 848 forks source link

Safari iPad not a mobile device #1811

Closed PascalLadalle closed 3 years ago

PascalLadalle commented 4 years ago

User reports on the forum that Safari on iPad does not trigger the 'mobile device' condition.

There's a setting in Safari for this, but by default, it's sending a desktop identity.

The problem seems to lie here: newIDE/app/src/Utils/Platform.js

Details and potential fixes: https://github.com/lancedikson/bowser/issues/329 https://stackoverflow.com/questions/58344491/request-browser-ismobiledevice-not-working-with-ipadair2-and-ios-13-0-1/60553965#60553965

More like a mistake on Apple's side, but it's year-old now, seems like they won't change their mind. 🤔

4ian commented 4 years ago

I guess the real issue is not what is or is not a mobile device, but what are users using this for? I guess it's for detecting if virtual controls should be displayed. In which case it's indeed not correct in the current state!

Maybe a good solution would be to have a condition to detect if the screen is a touchscreen or if a keyboard exists on the device.

PawBud commented 4 years ago

This issue looks interesting!

If we are OK that touch screen iBooks or iMacs are considered mobile, then we can resort to a simple (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) like extra approach. This would work if our main reason is related to touch screen navigation.

We don't want this, hence keyboard is the way to go but I can't think of a way to differentiate them using keyboard in the Platforn.js file, @4ian can you further elaborate.

K-Kumar-01 commented 3 years ago

@4ian The platform thing we are looking for, can you please specify the file in which it is located. I think there is a solution which may be possible.

4ian commented 3 years ago

I've never closed this issue but this is actually fixed. iPad are now properly considered as mobile by the condition checking if the device is mobile.

Implemented here: https://github.com/4ian/GDevelop/blob/30f96205cb71ab054fb5cbb04953de50d4ddf76b/Extensions/SystemInfo/systeminfotools.js#L43-L52