docs(motion): add orientation listener example to README#2558
docs(motion): add orientation listener example to README#2558OS-ruimoreiramendes wants to merge 4 commits into
Conversation
jcesarmobile
left a comment
There was a problem hiding this comment.
can this be separate examples?
users might want to listen for the events separately, should look more to what we do in the example app
https://github.com/ionic-team/capacitor-testapp/blob/main/src/pages/Motion.tsx
|
Released dev build of motion with dev version: 8.0.1-dev-2558-20260702T163136.0 |
@jcesarmobile I've split the doc into two separate examples. Take another look when you can. |
|
The text says "most browsers require permission check", but that's not true, the permissions are iOS only, the current examples result in the code not working on Android/Web, it should check if the requestPermission method is available before trying to call it, check MDN examples. BTW, Capacitor 7 is out of support, so there is no need to cherry-pick anymore. |
@jcesarmobile Updated the intro to make the permission check iOS-only, and guarded both Regarding the 7.x backport, I'll go ahead and cherry-pick this once merged so we can bundle it with the other pending 7.x changes for the final release. |
| permission on any user-initiated action (such as a button click): | ||
| This plugin is currently implemented using Web APIs. On iOS, permission must | ||
| be requested before accessing device motion or orientation events. Other | ||
| platforms do not require the check. To request permission, prompt the user |
There was a problem hiding this comment.
It's iOS devices, including web platform when testing on iOS devices, not just iOS platform, so "Other platforms" is not correct.
There was a problem hiding this comment.
Take another look please
README
Description
Add an 'orientation' listener example to the Motion plugin README alongside the existing 'accel' one.
Closes #2539.
Change Type
Notes / Comments
Plan to backport to 7.x.