我能够在模拟器中测试正常的通知,但是当我尝试测试丰富的通知时没有任何反应,事件标题没有得到更新。
你能帮我吗,如何进行。我需要更改任何模拟器设置吗?我正在使用 Xcode 11.4
样本有效载荷:
{
"aps": {
"mutable-content": 1,
"alert": {
"body": "Push notification body",
"title": "Push notification title"
}
},
"media-url": "https://i.imgur.com/t4WGJQx.jpg"
}
NotificationService 扩展方法:
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]",
self.bestAttemptContent.title];
}