ios
ios copied to clipboard
Time sensitive notification doesn't work
I see the implementation for param mapping for the iOS notification interruptionLevel
@implementation RCTConvert (UNNotificationInterruptionLevel)
RCT_ENUM_CONVERTER(UNNotificationInterruptionLevel,
(@{
@"passive": @(UNNotificationInterruptionLevelPassive),
@"active": @(UNNotificationInterruptionLevelActive),
@"timeSensitive": @(UNNotificationInterruptionLevelTimeSensitive),
@"critical": @(UNNotificationInterruptionLevelCritical)
}),
0,
integerValue)
@end
and
if (@available(iOS 15.0, *)) {
UNNotificationInterruptionLevel interruptionLevel =[RCTConvert UNNotificationInterruptionLevel:details[@"interruptionLevel"]];
if(interruptionLevel) {
content.interruptionLevel = interruptionLevel;
}
}
with values enum converted
passive
active
timeSensitive
critical
I tried the following code to invoke local notification
PushNotificationIOS.addNotificationRequest({
id,
title: 'hello world',
body: 'Lorem ipsum',
interruptionLevel: 'timeSensitive',
});
notification doesn't show in focus mode while time-sensitive notifications are allowed, just show in the summary while in focus
also, the TS type for the NotificationRequest param doesn't have the interruptionLevel key either