用于管理推送通知的 iOS API

标签 ios push-notification

希望不大,但是是否有任何公共(public)(或私有(private))API 允许我们在 iOS 设备上读取现有的推送通知?例如,后台运行的应用能否每隔 X 秒轮询一次系统,以确定设备是否收到来自 Stack Exchange 应用的推送通知并获取其内容?

这里的想法是有些服务(例如 Ring Video Doorbell)还没有公共(public) REST API。但是当 Ring 摄像头检测到运动时,它会发送推送通知。与流行的 IFTTT 服务类似,此应用会轮询设备上的通知,然后根据用户设置的标准执行某些操作。

我想至少必须有一个私有(private) API,因为 Apple 会在通知中心显示设备的最新通知。

最佳答案

即使可以使用违 react 用安全的不受支持的 API,推送通知的内容也会被加密,您可能无法阅读内容。

但是,Apple 的开发者网站提供了有关通过蓝牙为蓝牙 ANCS 中继其他应用程序的推送通知并与之交互的信息。

"The purpose of the Apple Notification Center Service (ANCS) is to give Bluetooth accessories (that connect to iOS devices through a Bluetooth low-energy link) a simple and convenient way to access many kinds of notifications that are generated on iOS devices."

https://developer.apple.com/library/content/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html#//apple_ref/doc/uid/TP40013460-CH2-SW1

这可能不适用于您,但这是 Apple 认可的与其他应用程序交互并将推送通知转发到蓝牙设备的方法。

关于用于管理推送通知的 iOS API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43261293/

相关文章:

c++ - 如何在 ios 设备中写入日志文件?

iphone - 如何在不更改 iPhone 应用程序中的设备方向的情况下更改应用程序的方向

ios - 如何在 prepareForSegue 方法中访问对象数组中选定对象的不同属性或特性

android - 在后台解析推送通知

Android 通知 Firebase Cloud

iOS Flutter 没有收到推送通知

ios - 根据方向切换 Storyboard

ios - 推送通知未送达

iOS 推送通知无法使用 Phonegap-plugin-push 通过 GCM 工作

android - FCM 在被杀死时向 Chrome 推送通知