
基础产品
适用各种通信场景,接入灵活

融合场景
专为场景打造,接入成本低

扩展能力
核心能力延展,功能全面

更多服务
一站式服务,满足各种需求
回答:
在NotificationService.m文件
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
NSDictionary *aps = [request.content objectForKey:@"aps"];
NSString *category = [aps objectForKey:@"category"];
if (category && [category isEqualToString:@"RC:VCHangup"]) {
NSString *identifier = [aps objectForKey:@"thread-id"];
if (identifier) {
[[UNUserNotificationCenter currentNotificationCenter] removeDeliveredNotificationsWithIdentifiers:@[identifier]];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.bestAttemptContent = [request.content mutableCopy];
self.contentHandler(self.bestAttemptContent);
});
} else {
self.contentHandler(self.bestAttemptContent);
}
}