diff --git a/README.md b/README.md index bd318be61..3e1a3ab01 100644 --- a/README.md +++ b/README.md @@ -437,6 +437,8 @@ See what push permissions are currently enabled. - `alert` :boolean - `badge` :boolean - `sound` :boolean +- `lockScreen` :boolean +- `notificationCenter` :boolean --- diff --git a/ios/RNCPushNotificationIOS.m b/ios/RNCPushNotificationIOS.m index aa7acfe73..343dbb6eb 100644 --- a/ios/RNCPushNotificationIOS.m +++ b/ios/RNCPushNotificationIOS.m @@ -342,7 +342,7 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification RCT_EXPORT_METHOD(checkPermissions:(RCTResponseSenderBlock)callback) { if (RCTRunningInAppExtension()) { - callback(@[RCTSettingsDictForUNNotificationSettings(NO, NO, NO)]); + callback(@[RCTSettingsDictForUNNotificationSettings(NO, NO, NO, NO, NO)]); return; } @@ -354,12 +354,14 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification static inline NSDictionary *RCTPromiseResolveValueForUNNotificationSettings(UNNotificationSettings* _Nonnull settings) { return RCTSettingsDictForUNNotificationSettings(settings.alertSetting == UNNotificationSettingEnabled, settings.badgeSetting == UNNotificationSettingEnabled, - settings.soundSetting == UNNotificationSettingEnabled); + settings.soundSetting == UNNotificationSettingEnabled, + settings.lockScreenSetting == UNNotificationSettingEnabled, + settings.notificationCenterSetting == UNNotificationSettingEnabled); } -static inline NSDictionary *RCTSettingsDictForUNNotificationSettings(BOOL alert, BOOL badge, BOOL sound) { - return @{@"alert": @(alert), @"badge": @(badge), @"sound": @(sound)}; - } +static inline NSDictionary *RCTSettingsDictForUNNotificationSettings(BOOL alert, BOOL badge, BOOL sound, BOOL lockScreen, BOOL notificationCenter) { + return @{@"alert": @(alert), @"badge": @(badge), @"sound": @(sound), @"lockScreen": @(lockScreen), @"notificationCenter": @(notificationCenter)}; + } RCT_EXPORT_METHOD(presentLocalNotification:(UILocalNotification *)notification)