DeviceOrientationEvent.requestPermission() - how to use in Angular capacitor app?

I’m trying to use this in an Ionic Angular capacitor project, it is needed to get device orientation working in IOS, but it is not accepted by VS Code…



Property ‘requestPermission’ does not exist on type ‘{ new (type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; prototype: DeviceOrientationEvent; }’.ts(2339)

(DeviceMotionEvent as any).requestPermission()

This gets rid of the error, not sure yet if it works though?

Doesn’t appear to work.