Pc.platform strange results on Quest 2

pc.platform is exactly what my team is after, but we get some very strange values on a Quest 2 headset… based on the following code:

console.error('Android ['         + pc.platform.android    + ']');    
console.error('Desktop ['         + pc.platform.desktop    + ']'); 
console.error('GamePads ['        + pc.platform.gamepads   + ']'); 
console.error('iOS ['             + pc.platform.ios        + ']');
console.error('Mobile ['          + pc.platform.mobile     + ']');
console.error('Touch ['           + pc.platform.touch      + ']');
console.error('Windows ['         + pc.platform.windows    + ']');
console.error('Web Workers ['     + pc.platform.workers    + ']');  
console.error('Xbox ['            + pc.platform.xbox       + ']');

We get…

Android     [false]
Desktop     [true]
Gamepads    [true]
iOS         [false]
Mobile      [false]
Touch       [true]
Windows     [false]
Web workers [true]
Xbox        [false]

…er, shouldn’t it be more like…

Android     [true]
Desktop     [false]
Gamepads    [true]
iOS         [false]
Mobile      [true]
Touch       [true?]
Windows     [false]
Web workers [true]
Xbox        [false]

That is based off the user agent of the browser. I can’t find any information now of what the browser on the Quest provides but I suspect that it would like iPad OS where the user agent is set to be a desktop, not mobile.

1 Like

Interesting interesting, I see. It sounds like it can’t be helped since it’s what the browser is reporting, no stress. Thanks for explaining!

Not ruling out we have a bug :sweat_smile: but that would be my best guess!

1 Like

Absolutely. In the mean time, I can still work backwards prioritizing this.app.xr.isAvailable(pc.XRTYPE_VR) above these other flags for now.