Skip to content

Commit

Permalink
fix(ios, messaging): add ios version guard for `UNAuthorizationOption…
Browse files Browse the repository at this point in the history
…ProvidesAppNotificationSettings` (#5986)

Add check for `UNAuthorizationOptionProvidesAppNotificationSettings` in iOS 12 and newer

Co-authored-by: Mike Hardy <github@mikehardy.net>
  • Loading branch information
matinzd and mikehardy committed Jan 4, 2022
1 parent 8015779 commit e8922c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/messaging/ios/RNFBMessaging/RNFBMessagingModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ - (NSDictionary *)constantsToExport {
}

if ([permissions[@"providesAppNotificationSettings"] isEqual:@(YES)]) {
options |= UNAuthorizationOptionProvidesAppNotificationSettings;
if (@available(iOS 12, macOS 10.14, macCatalyst 13, tvOS 12, watchOS 5, *)) {
options |= UNAuthorizationOptionProvidesAppNotificationSettings;
}
}

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
Expand Down

1 comment on commit e8922c0

@vercel
Copy link

@vercel vercel bot commented on e8922c0 Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.