ios - 接收 PushKit VoIP 通知 iOS

标签 ios objective-c pushkit

我正在将 PushKit 集成到我的 iOS 应用程序中,并准备好客户端代码。我正在使用 PKPushRegistry 进行注册,并在我的委托(delegate)中接收带有 token 的 PKPushCredential。我正在将此 token 注册到与 APNS 通信的服务器。

我找不到关于从我的服务器发送什么到 APNS 以向客户端发送 VoIP 推送通知的好文档。我是否只是通过用我的 VoIP .pem 替换我的 Remote Notifications .pem 发送一个带有 content-available:1 的普通远程通知请求来推送?

最佳答案

感谢您提出这个问题。

请阅读下面有关 Apple PushKit 的一些有用信息,或者您也可以阅读 Apple official page .

The PushKit framework provides the classes for your iOS apps to receive pushes from remote servers. Pushes can be of one of two types: standard and VoIP. Standard pushes can deliver notifications just as in previous versions of iOS. VoIP pushes provide additional functionality on top of the standard push that is needed to VoIP apps to perform on-demand processing of the push before displaying a notification to the user.

  1. Apple PushKit 不是简单的 APNS,而是静默推送 通知,以便您的应用程序在您收到时不会使用react 推送通知。

  2. 我们需要在您需要时手动安排 UILocalNotification 从服务器接收推送。

  3. UILocalNotification

    中显示您想要显示给用户的内容

一些著名的应用程序使用 PushKit 进行通知,例如 WhatsApp、Skype

仅发送将用于生成本地通知的有用信息。

关于ios - 接收 PushKit VoIP 通知 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39784696/

相关文章:

iphone - 在包含错误的 UITextfield 周围制作一个红色边框

objective-c - 如何缓存弹出 Controller ?

ios - 如何显示多个本地通知?

ios - UIView宽度问题

ios - 如何调整自定义 iOS 相机应用程序的白平衡设置?

objective-c - 如何在 Xcode 中定义预处理器符号

swift - Sinch:用户不是第一次接到电话

ios - 方法 didInvalidatePushTokenForType 未调用使用 Twilio 过期的 token

ios - CollectionView 在 StackView 中消失(Swift)

使用 VoiceOver 时不调用 JavaScript 函数