schatzkin
schatzkin

Reputation: 329

How to detect Oculus Go?

I'm looking at this question: How to detect Desktop vs. Mobile vs. GearVR vs. Oculus Rift vs. Vive in A-Frame?

It seems that AFRAME.utils.device.isMobile() is seeing the Go as a mobile device.

Upvotes: 1

Views: 779

Answers (1)

Diego Marcos
Diego Marcos

Reputation: 4585

The check will ship in A-Frame 0.9.0 (as one of the comments mentioned). In the meantime you can incorporate the code to your application:

function isOculusGo () {
  return /Pacific Build.+OculusBrowser.+SamsungBrowser.+MobileVR/i.test(window.navigator.userAgent);
} 

This checks relies on the specific navigator.userAgent strings of the browsers available on Go (Oculus Browser and Samsung Internet). It's not super robust but the only known way to do it at the moment. Mozilla Firefox Reality has just been released and the expression above does not take it into consideration. I don't have a Go available to access the userAgent.

Upvotes: 1

Related Questions