在接入第三方推送的時候,我犯了一個錯誤脸侥,這個錯誤直接導(dǎo)致了推送在發(fā)出后每次都會延遲30秒手機(jī)才會彈出推送提示框驹愚。
導(dǎo)致這個問題的主要原因就是當(dāng)在加入NotificationService后,在NotificationService.m文件的?- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler 這個方法中近尚,我修改和添加了部分代碼砾省,但是沒有最終執(zhí)行代碼原有部分株搔,即:
self.contentHandler= contentHandler;
?self.bestAttemptContent= [request.contentmutableCopy];
self.contentHandler(self.bestAttemptContent);
后來將這幾句代碼重新補足后,延遲問題解決纯蛾。