Skip to content

fix: request DeviceMotionEvent permission on iOS for mobile device movement example - #1602

Open
tirthraj01 wants to merge 1 commit into
processing:mainfrom
tirthraj01:fix/mobile-device-movement-ios-permission
Open

tirthraj01 wants to merge 1 commit into
processing:mainfrom
tirthraj01:fix/mobile-device-movement-ios-permission

Conversation

@tirthraj01

Copy link
Copy Markdown

Closes #1583

What changed

Added DeviceMotionEvent.requestPermission() call behind an "Enable Motion" button
for iOS 13+ browsers. On iOS, device motion events silently fail without this
user-gesture-triggered permission request.

How it works

  • If DeviceMotionEvent.requestPermission exists (iOS 13+): shows a button.
    On tap, requests permission and removes the button on approval.
  • On all other devices: works exactly as before (no button shown).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mobile] Mobile Device Movement Sketch Not Working

1 participant