Baseflow / Baseflow/flutter-permission-handler
iOS: Permission prompt disapears on screen lock and await never completes.
- Dominant language
- Dart
- Stars
- 2.2k
- Forks
- 970
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 2
Description
## 🐛 Bug Report
Hi there, I'm not 100% sure if this is a bug, or an iOS behavior that can be handled in a way I'm unaware of. But hoping raising this here will lead to answers.
In the code I use the following to prompt a permission location.
`await Permission.locationWhenInUse.request();`
under normal expected circumstances this works as expected. However on iOS if I lock the screen while the permission prompt is up, the permission prompt disappears and it appears that the await keeps waiting for a response. As in this particular case I have this as a series of set up actions waiting on each other. And so I get stuck unable to move on as this happens as that particular screen doesn't have any navigation as it auto navigates once completed.
However if I move it to a different screen and do the same trigger, it still disappears, but I am at least not stuck. I know I can theoretically try to re-trigger it on resume, or trigger it through a button press, but because of this stuck behavior that appears with the current set up, I am concerned about how the fact the await never resolved might effect the app's memory and cause issues if it were to happen several times. (someone locking and unlocking it over and over again for example)
Has anyone seen this before? I can't quite pin point if this is a bug with the package, or an issue with my set up.
### Expected behavior
The Permission prompt does not dismiss on screen lock. Or if this is expected by iOS, re-prompts the permission prompt.
### Reproduction steps
Trigger a permission prompt on iOS
Lock the screen
Unlock the screen
### Configuration
**Version:** 10.2.0
**Platform:**
- [X] :iphone: iOS
- [ ] :robot: Android
Contributor guide
Assessment
This issue has not been assessed yet.