Not sure if this is because it is on the web (via ionic serve), but the plugin should work on web, android, iOS. Should I not get readings back from the sensors?
If I run my code native on Android, then the request permission also does not work, and I do not even get the event from the Motion plugin back.
Question:
Does anybody have any pointers/links to tutorials, github repos, etc. that have a working example of that plugin?
Has anybody worked with this plugin across PWA, android, iOS and can confirm that it actually works in v2/v3 beta?
With capacitor now in v3 beta, should we still start projects with v2?
What is going to happen to ionic native long term? Are you maintaining the long existing list of ionic native plugins or will efforts be shifted to grow capacitor? (Apologies if I have missed a blog article on that in the past.)
Just wondering if anybody has some ideas around this please. This forum unfortunately seems “pretty quite” - does anybody else have ideas for community support?
You only have to request the permission on iOS 13+, so first check if DeviceMotionEvent.requestPermission is defined, and if not, don’t try to request the permission because it’s not needed and won’t work.
Hey , I’m having the exact problem you have with capacitor motion plugin in version 3,have you found out something?
I tried controlling request permission not found exception (on Android), and even then, adding Motion.addlistener returns ok (no catch code being executed) but no event is fired…
I’m starting to get really disappointed with this platform, as I’m having very bad heading measures from background geolocation plugin as well, compared with cordova plugin for this (but at least works, adding the corresponding permissions to Android manifest)…
I read those documents to learn that the motion plugin is virtually incompatible with Safari, which would have saved me some time.
The example code supplied on the Capacitor page doesn’t work with Ionic, so that also wastes time.
I used Ionic because it is meant to save me time. There are web based compass examples that do appear to work, but I am not knowledgeable enough to know how to implement that code within Ionic.