|
|
@@ -181,7 +181,6 @@ RCT_EXPORT_METHOD(addSunPush:(id)array){
|
|
|
//identifiers规则 https://shimo.im/docs/VMAPLmQ7xVcWmeAg
|
|
|
[center removePendingNotificationRequestsWithIdentifiers:ids];
|
|
|
|
|
|
- NSMutableArray *list = [NSMutableArray new];
|
|
|
NSUInteger count = [array count];
|
|
|
if (count>30){
|
|
|
count = 30;
|
|
|
@@ -201,20 +200,18 @@ RCT_EXPORT_METHOD(addSunPush:(id)array){
|
|
|
content.title = detail[@"title"];
|
|
|
content.body = detail[@"body"];
|
|
|
content.sound = [UNNotificationSound defaultSound];
|
|
|
- content.badge = @([UIApplication sharedApplication].applicationIconBadgeNumber + 1);
|
|
|
+ content.badge = @(1);//@([UIApplication sharedApplication].applicationIconBadgeNumber + 1);
|
|
|
|
|
|
|
|
|
- UNNotificationCategory *categroy = [UNNotificationCategory categoryWithIdentifier:[NSString stringWithFormat:@"%@",detail[@"timestamp"]] actions:@[] intentIdentifiers:@[] options:UNNotificationCategoryOptionCustomDismissAction];
|
|
|
- [list addObject:categroy];
|
|
|
- // [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:categroy]];
|
|
|
- content.categoryIdentifier = [NSString stringWithFormat:@"%@",detail[@"timestamp"]];
|
|
|
+// UNNotificationCategory *categroy = [UNNotificationCategory categoryWithIdentifier:[NSString stringWithFormat:@"%@",detail[@"timestamp"]] actions:@[] intentIdentifiers:@[] options:UNNotificationCategoryOptionCustomDismissAction];
|
|
|
+// [list addObject:categroy];
|
|
|
+// content.categoryIdentifier = [NSString stringWithFormat:@"%@",detail[@"timestamp"]];
|
|
|
|
|
|
UNTimeIntervalNotificationTrigger * trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:timeInterval repeats:NO];
|
|
|
UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:[NSString stringWithFormat:@"REMINDER_SUN_%@",detail[@"timestamp"]] content:content trigger:trigger];
|
|
|
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
|
|
|
}];
|
|
|
}
|
|
|
- [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithArray:list]];
|
|
|
}
|
|
|
|
|
|
- (void)addFSNotifications:(id)array{
|