@@ -844,7 +844,7 @@ - (void) CheckNotificationAuthorization :(int) channelID {
844
844
}
845
845
}
846
846
847
- - (UNMutableNotificationContent *)createNotificationContentWithTitle : (const char *)title subtitle : (const char *)subtitle body : (const char *)body dataJSON : (const char *)dataJSON error : (NSError **)contentError API_AVAILABLE(macos(10.14 )) {
847
+ - (UNMutableNotificationContent *)createNotificationContent : (const char *)title subtitle : (const char *)subtitle body : (const char *)body dataJSON : (const char *)dataJSON error : (NSError **)contentError API_AVAILABLE(macos(10.14 )) {
848
848
NSString *nsTitle = [NSString stringWithUTF8String: title];
849
849
NSString *nsSubtitle = subtitle ? [NSString stringWithUTF8String: subtitle] : @" " ;
850
850
NSString *nsBody = [NSString stringWithUTF8String: body];
@@ -884,21 +884,15 @@ - (void) SendNotification:(int)channelID :(const char *)identifier :(const char
884
884
NSString *nsIdentifier = [NSString stringWithUTF8String: identifier];
885
885
886
886
NSError *contentError = nil ;
887
- UNMutableNotificationContent *content = [self createNotificationContentWithTitle: title
888
- subtitle: subtitle
889
- body: body
890
- dataJSON: dataJSON
891
- error: &contentError];
887
+ UNMutableNotificationContent *content = [self createNotificationContent: title subtitle: subtitle body: body dataJSON: dataJSON error: &contentError];
892
888
if (contentError) {
893
889
NSString *errorMsg = [NSString stringWithFormat: @" Error: %@ " , [contentError localizedDescription ]];
894
890
captureResult (channelID, false , [errorMsg UTF8String ]);
895
891
return ;
896
892
}
897
893
898
894
UNTimeIntervalNotificationTrigger *trigger = nil ;
899
- UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier: nsIdentifier
900
- content: content
901
- trigger: trigger];
895
+ UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier: nsIdentifier content: content trigger: trigger];
902
896
903
897
[center addNotificationRequest: request withCompletionHandler: ^(NSError * _Nullable error) {
904
898
if (error) {
@@ -922,7 +916,7 @@ - (void) SendNotificationWithActions:(int)channelID :(const char *)identifier :(
922
916
NSString *nsCategoryId = [NSString stringWithUTF8String: categoryId];
923
917
924
918
NSError *contentError = nil ;
925
- UNMutableNotificationContent *content = [self createNotificationContentWithTitle : title
919
+ UNMutableNotificationContent *content = [self createNotificationContent : title
926
920
subtitle: subtitle
927
921
body: body
928
922
dataJSON: dataJSON
0 commit comments