iOS推送1.3.2及以前推送版本升级指导
新接口
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
[GrowingPushExtensionKit handleNotificationRequest:request
withCompletion:^(NSArray<UNNotificationAttachment *> * _Nullable attachments, NSArray<NSError *> * _Nullable errors) {
NSLog(@"执行成功");
NSLog(@"回调信息是 attachments = %@, error = %@", attachments, errors);
// Modify the notification content here...
self.bestAttemptContent.attachments = attachments;
self.contentHandler(self.bestAttemptContent);
}];
}Last updated
Was this helpful?