How do I specifically detect Apple devices?

Q&A about the latest versions
Post Reply
Branigan
Posts: 14
Joined: Tue May 19, 2020 3:43 pm

Fri May 22, 2020 4:43 pm

How can I detect Apple devices to trigger different behaviours?

Saw the 'Has Touch' and 'Is Mobile' triggers, but can't see how to exclude all Apple OSes from the results and I want to include desktops as well as iOS phones/tablets.

Basically, I don't want it to look like the 'Full Screen' button is broken - when it is ignored on Apple browsers - as it works fine on PCs, Android tablets and phones, so I want to keep it on those.



Edit: this link is a 404 https://ggnome.com/wiki/html5-cube-face ... e-devices/
digitalnoodle
Posts: 9
Joined: Mon Apr 13, 2020 1:02 pm

Sun May 24, 2020 1:17 am

You might be able to have a browser detection scheme put into a text field with javascript, then have the that script change a variable to a particular value that can trigger the correct visibility of the elements.

I do this kind of thing in my html template, changing the variable just after the pano loads. I think I used the beforechangenode event.

Do know that browser detecting is not perfect, but in my experience it is usually pretty reliable - so be careful when you search for browser/OS detection code that you get a good one.

See: pano.setVariableValue(varName:String, varValue:Any) in the javascript api docs.

https://ggnome.com/doc/javascript-api/
User avatar
k.ary.n
Gnome
Posts: 362
Joined: Wed Aug 15, 2007 1:02 pm

Tue May 26, 2020 12:17 pm

You can add a logic block to, for example, the visible property of the fullscreen button.

You'll find the iOS trigger under Advanced > Operating System
Attachments
Screen Shot 2020-05-26 at 12.14.49 PM.png
Screen Shot 2020-05-26 at 12.14.49 PM.png (90.16 KiB) Viewed 32 times
Branigan
Posts: 14
Joined: Tue May 19, 2020 3:43 pm

Wed May 27, 2020 2:42 pm

OK, thanks, but as iOS and MacOs are separate checks, how would I combine them into a single 'false'? so everything else is true?
Post Reply