-
-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Motion permission isGranted sometimes return FALSE on iOS even though the permission is granted by the user #1294
Comments
Hi @WUKS87, Does this problem occur on a real device or are you only experiencing it on the simulator. Can you provide more details about the devices on which the problem occurs (iPhone model, iOS version). Internally the permission_handler uses the CMMotionActivityManager to check authorization status. Unfortunately Apple doesn't provide a explicit method to request permission, so our solution is to query the It is possible that if the user selects "Allow once" that the next time you check the permission status the result is "denied". Can you provide a more detailed use case or steps that we can use to try and reproduce the problem? |
It is happening on real devices, it's on our production. We have few iOS devices for testing and we never saw this behaviour.
Our users have setup for the app, where they go through steps and they need to allow some permissions. What you said about "Allow once" could make sense. I wrote something about "Allow once" problem in this thread: |
@mvanbeusekom I have some new updates on this. User allowed "Always Allow" through the app setup and in the Motion step user did NOT get Permission Modal to allow Motion Sensor. Motion Sensor is mandatory for using our app, these users become blocked for usage. Please advise if there is a way for some workaround? Thank you. |
Hi @WUKS87, Thank you for providing additional information. However the process is not really clear to me. In your previous comment you mention:
I don't really understand how the user "Always Allow" the motion permission if the permission modal is not displayed? Can you explain this a bit more detailed? You also mentioned that the application doesn't see motion sensor at all in the App Settings, this usually is the case when the permissions are not added to the I also had have experience where people have a damaged motion sensor (maybe because they dropped their phone or otherwise), this might also related to similar behavior and might explain why most user don't experience any problems. |
User is going through our app setup by steps.
In |
Reading up on the use of motion data in an iOS application, it seems that there is no need to explicitly request permissions (see iOS documentation). Although the documentation isn't really clear about it, the In the permission_handler we use the
So in other words:
|
So, it means that users who don’t get the permission modal for Motion don't have any history of motion events, right? As I can see here it can send notification for current motion changes as well as motion history data. |
It really depends on the plugin you are using to acquire motion data and which iOS SDK they are using to fetch the information. If the plugin is only using To request permission the permission_handler also quickly instantiates the Again if the application is only using the |
Ok, I will check what my plugin is using. |
Did you create your own plugin or are you using an open source plugin. The reason I am asking is that maybe I can also have a look. |
@mvanbeusekom This is what I'm using: |
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
Expected results
await Permission.sensors.isGranted;
Should return correct bool value.
Actual results
await Permission.sensors.isGranted;
On rare occasions FALSE is returned even though user granted permission.
Code sample
Request sensor for iOS
Check granted status for iOS
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
11.3.0
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: