How do I specifically detect Apple devices?

Q&A about the latest versions
Post Reply
Branigan
Posts: 231
Joined: Tue May 19, 2020 3: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.
Last edited by Branigan on Mon Jun 01, 2020 2:43 pm, edited 1 time in total.
digitalnoodle
Posts: 9
Joined: Mon Apr 13, 2020 1:02 pm

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: 615
Joined: Wed Aug 15, 2007 1:02 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 1373 times
Branigan
Posts: 231
Joined: Tue May 19, 2020 3:43 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