Questions tagged «silent-notification»

5
当应用程序在后台运行时,iOS 13.3中未调用didReceiveRemoteNotification
我在敲头。我正在实施推送通知。一切正常(接收到推送,更新了徽章),但是在iOS 13.3下,当应用程序在后台运行时,不会调用application(_:didReceiveRemoteNotification:fetchCompletionHandler :)方法。如果应用程序在前台或使用iOS 12设备,则将调用该方法。我通过以下方式注册推送通知: [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError * _Nullable error) { if (granted) { dispatch_async(dispatch_get_main_queue(), ^{ [[UIApplication sharedApplication] registerForRemoteNotifications]; }); } }]; 有效负载设置为以下 {"aps": { "badge": 10, "alert": "test", "content-available": 1 }} 我尝试在所有变体中添加“远程通知”和“背景处理”作为应用程序功能(仅“远程通知” /“背景处理”,而没有其中的任何一项功能,同时启用了这两项),而没有进行任何更改。我为UNUserNotificationCenter设置了委托,但是再次失败了。我相应地设置标题: curl -v \ -H 'apns-priority: 4' \ -H 'apns-topic: …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.