Skip to content
Open
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ typedef NS_ENUM(NSInteger, DateTimeComponents) {
details:error.domain];
}

// iOS 27 fails with error 2002 when a notification only updates the badge,
// although the badge is still applied
static BOOL isBadgeOnlyNotificationError(NSError *error) {
return [error.domain isEqualToString:UNErrorDomain] && error.code == 2002;
Comment thread
MaikuB marked this conversation as resolved.
Outdated
}

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
FlutterMethodChannel *channel =
[FlutterMethodChannel methodChannelWithName:CHANNEL
Expand Down Expand Up @@ -999,7 +1005,7 @@ - (void)addNotificationRequest:(NSString *)identifier
[UNUserNotificationCenter currentNotificationCenter];
[center addNotificationRequest:notificationRequest
withCompletionHandler:^(NSError *_Nullable error) {
if (error == nil) {
if (error == nil || isBadgeOnlyNotificationError(error)) {
result(nil);
return;
}
Expand Down
Loading