ios - 我可以使用 PushKit 进行定期推送而不使用 VoIP 吗?如果用户不根据通知采取行动,是否会允许在后台启动已终止的应用程序?

标签 ios ios8 push-notification apple-push-notifications appdelegate

在 PushKit 中提到我们可以使用常规推送或 VoIP 推送。但是我没有找到任何关于 PKPushType 用于常规推送的文档。 有人尝试使用 PushKit 进行常规推送吗? 如果我不使用 VoIP,如果收到推送通知,是否有可能在后台启动已终止的应用程序?意思是如果应用程序被杀死并且收到通知并且用户没有采取任何行动,如果我使用 PushKit,应用程序可以在后台由 iOS 启动吗?

最佳答案

从 iOS 13.0 开始,不再允许这样做。如果在 didReceiveIncomingPush(withPayload:) 完成之前无法呈现 CallKit,Apple 将终止该应用。

Apple 员工在 this thread 中回答了类似的问题并说了以下内容:

On iOS 13.0 and later, incoming Voice over IP calls must be reported when they are received and before the didReceiceIncomingPush() method finishes execution, using the CallKit framework, or the system will terminate your app.

Repeatedly failing to report calls may prevent your app from receiving any more incoming call notifications.

Basically, you can no longer use VoIP pushes for non VoIP messaging, and will need to use regular push notifications for those.

This was announced during the WWDC session "Advances in App Background Execution" https://developer.apple.com/videos/play/wwdc2019/707/

很遗憾现在没有了。我们将不得不为“标准”推送消息使用普通的 UINotification 框架。

关于ios - 我可以使用 PushKit 进行定期推送而不使用 VoIP 吗?如果用户不根据通知采取行动,是否会允许在后台启动已终止的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29703386/

相关文章:

ios - 在 Firebase 中查询用户以检查注册过程中用户名是否存在

ios - 使用 AVFoundation 在顶部创建具有自定义背景颜色和适合纵横比的视频的方形视频

objective-c - 使用 IOS 共享扩展启动应用程序

ios - 在 XCUITest 的可访问性指示器中找不到堆栈 View

在 ScreenUpdates :YES 之后调用 drawViewHierarchyInRect 时 iOS8 缩放故障

ios - 如何动态添加swift字典中的值

android - Android 是否支持近乎实时的推送通知?

ios - 为推送通知上传 iOS 设备 token

android: 实现推送通知

ios - 在 iOS 中的同一张 map 上使用默认和自定义 MKPointAnnotation