Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix App Tracking Transparency request may fail to show.#967

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
luiges90 wants to merge3 commits intoBaseflow:main
base:main
Choose a base branch
Loading
fromgogovan:fix/ios-app-tracking-transparency-request
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletionspermission_handler/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
## 10.2.1

* Fixed an issue where App Tracking Transparency prompt may not show correctly on iOS in some situations.

## 10.2.0

* Added support for the new Android 13 permissions: SCHEDULE_EXACT_ALARM, READ_MEDIA_IMAGES, READ_MEDIA_VIDEO and READ_MEDIA_AUDIO
Expand Down
4 changes: 2 additions & 2 deletionspermission_handler/pubspec.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
name: permission_handler
description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
version: 10.2.0
version: 10.2.1
repository: https://github.com/baseflow/flutter-permission-handler
issue_tracker: https://github.com/Baseflow/flutter-permission-handler/issues

Expand All@@ -23,7 +23,7 @@ dependencies:
sdk: flutter
meta: ^1.7.0
permission_handler_android: ^10.2.0
permission_handler_apple: ^9.0.7
permission_handler_apple: ^9.0.8
permission_handler_windows: ^0.1.2
permission_handler_platform_interface: ^3.9.0

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,27 @@

@implementation AppTrackingTransparencyPermissionStrategy

PermissionStatusHandler storedCompletionHandler = nil;

+ (void)load {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleAppBecomeActive)
name:UIApplicationDidBecomeActiveNotification
object:nil];
}

+ (void)handleAppBecomeActive {
if (@available(iOS 14, *)){
if (storedCompletionHandler != nil) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
PermissionStatus permissionStatus = [AppTrackingTransparencyPermissionStrategy parsePermission:status];
storedCompletionHandler(permissionStatus);
storedCompletionHandler = nil;
}];
}
}
}

- (PermissionStatus)checkPermissionStatus:(PermissionGroup)permission {
if (@available(iOS 14, *)) {
ATTrackingManagerAuthorizationStatus attPermission = [ATTrackingManager trackingAuthorizationStatus];
Expand All@@ -32,10 +53,17 @@ - (void)requestPermission:(PermissionGroup)permission completionHandler:(Permiss
}

if (@available(iOS 14, *)){
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
PermissionStatus permissionStatus = [AppTrackingTransparencyPermissionStrategy parsePermission:status];
completionHandler(permissionStatus);
}];
UIApplicationState state = [[UIApplication sharedApplication] applicationState];
if (state == UIApplicationStateActive) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
PermissionStatus permissionStatus = [AppTrackingTransparencyPermissionStrategy parsePermission:status];
completionHandler(permissionStatus);
}];
} else {
// If state is not UIApplicationStateActive, iOS will not show the dialog for requesting AppTrackingTransperancy permission.
// Store the completion handler and only start requesting when the app become Active again.
storedCompletionHandler = completionHandler;
}
} else {
completionHandler(PermissionStatusGranted);
}
Expand Down
2 changes: 1 addition & 1 deletionpermission_handler_apple/pubspec.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
name: permission_handler_apple
description: Permission plugin for Flutter. This plugin provides the iOS API to request and check permissions.
version: 9.0.7
version: 9.0.8
homepage: https://github.com/baseflow/flutter-permission-handler

environment:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp