You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hello,
An error appears when I try to set the plugin @capacitor/motion.
To reproduce
Steps to reproduce the behavior:
Install an blank ionic project + add www and ìos`
Install the plugin using these commands: npm install @capacitor/motionnpx cap sync
Open the file app.component.ts
Add the imports on the top of the file
In the function ngOnInit(), add the method to request the permission `await DeviceMotionEvent.requestPermission();``
See the error (red underline below requestPermission): Property 'requestPermission' does not exist on type '{ new (type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; prototype: DeviceMotionEvent; }'
Screenshot
Expected behavior
Don't have any error when I try to setup the plugin following the instructions.
Browser and OS (please complete the following information)
OS: MacOs Monterey 12.6
Browser: Chrome
Version: 105.0.5195.125
Thank you for your help,
Loïc
The text was updated successfully, but these errors were encountered:
I notice that this question was asked in the Ionic forum here.
So it looks like this is not a recent issue. Could you please help us to use this plugin with Ionic?
if((DeviceMotionEventasany).requestPermission){constresult=await(DeviceMotionEventasany).requestPermission();// This should return a result of 'granted'}
The DeviceMotionEvent.requestPermission API is available on some Safari/Mobile Safari/iOS versions so you need to check if the API exists before calling it.
Describe the bug
Hello,
An error appears when I try to set the plugin
@capacitor/motion
.To reproduce
Steps to reproduce the behavior:
www
and ìos`npm install @capacitor/motion
npx cap sync
app.component.ts
ngOnInit()
, add the method to request the permission `await DeviceMotionEvent.requestPermission();``requestPermission
):Property 'requestPermission' does not exist on type '{ new (type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; prototype: DeviceMotionEvent; }'
Screenshot
Expected behavior
Don't have any error when I try to setup the plugin following the instructions.
Browser and OS (please complete the following information)
Thank you for your help,
Loïc
The text was updated successfully, but these errors were encountered: