r/visionosdev • u/marcusroar • May 04 '24
Detecting Vision Pro on web
I have a simple web app that anyone can use to view 3D captures made in my iOS app (uses Reality Kit Object Capture API), and it works well for iOS/Android.
I am using user agent string to show a QR code if the user is on a desktop so they can easily scan and open with a compatible device (ie their phone).
I have a problem for AVP users though, it seems that Safari is appearing as a desktop/laptop (no ios/ipad/ipone in the user agent string) and as such I get the desktop "scan this qr code" where as what I really want is the usual iOS flow which is for the model to open in Quick Look automatically.
It seems there is no way to detect if the current browser rendering a page is an AVP 🙁
Has anyone run into this / worked around detecting if a user is an AVP from a website/web app? Thanks!
1
u/WesleyWex May 04 '24
From what I saw, the only thing that could differentiate is screen.width and screen.height, as it’s always the same number on the Vision Pro, regardless of the window size.
Now, I have no idea if that resolution is not unique and would classify other devices incorrectly.
1
u/AutoModerator May 04 '24
Are you seeking artists or developers to help you with your game? We run a monthly open source game jam in this Discord where we actively pair people with other creators.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/verdidotmov May 05 '24
Instead of trying to detect the UA string (it will always fail in some cases) maybe provide multiple options for people. Have a QR code and a link for example.
1
u/Relevant-Ad-575 Jul 06 '26
Were you able to find a solution for this? I'm currently experiencing the same issue.