Handle permission pop-ups in your Flutter Integration tests for Android
Matthew Harrington
While testing different scenarios, it is common for Android apps to present various pop-ups or system dialogs that request users to grant different permissions (e.g., contacts, notifications, photos, etc.) to the application.
Grant all permissions for Android apps
While testing your Android apps, use the Flutter’s autoGrantPermissions parameter to automatically determine which permissions your app requires and grant them to the app on install. These permissions are determined based on the Android manifest defined in the app’s .APK file.
To grant all permissions, set autoGrantPermissions to true when running a build using the builds REST API.
Example cURL request to enable autoGrantPermissions:
bash curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \ -X POST "" \ -d '{ "autoGrantPermissions": "true", "devices": ["Samsung Galaxy S9 Plus-9.0"], "app":"bs://69672c289c49d6a03623870b0704c336c6ea9118", "testSuite": "bs://94757b23f5318d9ce496b24c2d958f64cfe917e2"}' \ -H "Content-Type: application/json"
Did this page help you?
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback
Is this page helping you?
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!