flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

Fix App Tracking Transparency request may fail to show.

Open luiges90 opened this issue 1 year ago • 1 comments

:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Fix App Tracking Transparency authorization prompt may fail to show in iOS, due to iOS not showing the prompt unless the app is in an Active state. This often happens when multiple permissions are requested and App Tracking Transparency come after any other authorization prompts.

:arrow_heading_down: What is the current behavior?

When multiple permissions are requested at once (at client level), and App Tracking Transparency is in the middle of those permissions, the authorization prompt for App Tracking Transparency does not show and the plugin simply return "Denied" as permission authorization state.

:new: What is the new behavior (if this is a feature change)?

When multiple permissions are requested at once, App Tracking Transparency authorization request will first wait until the app is active again. This would normally happen after the last permission authorization request is dismissed. If the app is already in active state, App Tracking Transparency authorization will be asked immediately.

:boom: Does this PR introduce a breaking change?

No.

:bug: Recommendations for testing

Use this code on client, and run it on iOS devices.

Permission.notification.request();
Permission.appTrackingTransparency.request();

:memo: Links to relevant issues/docs

  • https://github.com/Baseflow/flutter-permission-handler/issues/676
  • https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc

:thinking: Checklist before submitting

  • [x] I made sure all projects build.
  • [x] I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • [x] I updated CHANGELOG.md to add a description of the change.
  • [x] I followed the style guide lines (code style guide).
  • [x] I updated the relevant documentation.
  • [x] I rebased onto current master.

luiges90 avatar Dec 22 '22 01:12 luiges90

is this going to be merged ?

moesaid avatar Mar 27 '23 19:03 moesaid