question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Show message on iOS to request user to enable devicemotion manually

See original GitHub issue

Since iOS 12.2 Safari devicemotion API comes disabled by default. The user has to enable manually on settings. We could detect iOS and if the API is disabled we can display a message above the enter VR button asking the user to enable.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
dmarcoscommented, May 1, 2019

Can just one feature detect devicemotion? A bit ugly but maybe:

var deviceMotionEvt;
setTimeout(function () { 
  if (!deviceMotionEvt && AFRAME.utils.isIOS()) { showMessage(); };
}, 1000);

window.addEventListener('devicemotion', function(event) {
  deviceMotionEvt = event;
});
1reaction
dmarcoscommented, May 21, 2019

Example on how 8th wall deals with the issue: https://github.com/aframevr/aframe/issues/3976#issuecomment-493035158

Read more comments on GitHub >

github_iconTop Results From Across the Web

DeviceMotion and DeviceOrientation in WKWebView iOS 13
But in my app inside I am using WKWebView and When I press Ask Permission Button, It is not showing any alert for...
Read more >
Unable to check DeviceOrientationEvent - Apple Developer
Hello there. With iOS12.2+ Apple changed the way to access DeviceOrientation and DeviceMotion in Safari: The user must first do any gesture (click...
Read more >
Device motion / orientation events not working in third-party ...
There is no satisfactory workaround for the above issue. Any consenting web application cannot prompt their users to request gyroscope ...
Read more >
How to Request Device Motion and Orientation Permission in ...
Learn how to Request Device Motion and Orientation Permission in iOS 13. ... The permissions API is a known user pattern and it...
Read more >
AuthSession - Expo Documentation
In order to be able to deep link back into your app, you will need to set a scheme in ... You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found