I have a problem in ios and ionic:
I develope an ionic app and I want to use the motion plugin. I need the direction of the Smartphone to show the user where he is looking.
I got this to work when I created an alert, which forced a click and the the prompt appears, to allow the motion permissions.
For that I use the “DeviceMotionEvent.requestPermission()” function.
But this permission seems not to be saved. On the next app start (removed from task and started new instance) the permission are not there and the user has to grant the permission again.
So my questions are:
Is there a way to save this permission like all other permissions like e.g. location?
I searched a whole day in the www but found nothing like that.
The next problem then is to be able to check, if the permission is already granted to be able to skip the annoying alert and following prompt.
Is there a way to check the permission without calling the requestPermission()function?
I hope you can help me here.