我可以使用 PushKit 在不使用 VoIP 的情况下进行常规推送吗?如果用户不按通知采取行动,它是否允许在后台启动被终止的应用程序? [英] Can I use PushKit to do regular push with out using VoIP? Will it allow killed app to be launched in background if user does not act on notification?

查看:27
本文介绍了我可以使用 PushKit 在不使用 VoIP 的情况下进行常规推送吗?如果用户不按通知采取行动,它是否允许在后台启动被终止的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In the PushKit it is mentioned we can use regular push or VoIP push. But I did not find any documentation for what PKPushType to use for regular push. Did anybody try the regular push using the PushKit? If I don't use VoIP is it possible for a killed app to be launched in the background if it receives push notification? Meaning if app is killed and a notification comes and user does not act on it, can the app be launched by iOS in the background if I use PushKit?

推荐答案

从 iOS 13.0 开始,这不再被允许.如果在 didReceiveIncomingPush(withPayload:) 完成之前未能呈现 CallKit,Apple 将终止该应用程序.

Since iOS 13.0, this is NOT allowed anymore. Apple will kill the app if failing to present CallKit before the didReceiveIncomingPush(withPayload:) is finished.

一位 Apple 员工在此主题中回答了类似问题,并表示如下:

An Apple Employee answered a similar question in this thread and said the following:

在 iOS 13.0 及更高版本上,必须在收到 IP 语音来电时且在 didReceiceIncomingPush() 方法完成执行之前使用 CallKit 框架进行报告,否则系统将终止您的应用.

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.

基本上,您不能再将 VoIP 推送用于非 VoIP 消息传递,而需要为这些消息使用常规推送通知.

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

这是在 WWDC 会议应用后台执行的进展"期间宣布的;https://developer.apple.com/videos/play/wwdc2019/707/

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

很遗憾不再是了.我们将不得不为标准"使用普通的 UINotification 框架.推送消息.

So sadly not anymore. We will have to use the normal UINotification framework for "standard" push messages.

这篇关于我可以使用 PushKit 在不使用 VoIP 的情况下进行常规推送吗?如果用户不按通知采取行动,它是否允许在后台启动被终止的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆