用于管理推送通知的 iOS API [英] iOS API to manage push notifications

查看:44
本文介绍了用于管理推送通知的 iOS API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个远景,但是否有任何公共(或私有)API 允许我们读取 iOS 设备上的现有推送通知?例如,后台运行的应用程序是否可以每隔 X 秒检测一次系统以确定设备是否已收到来自 Stack Exchange 应用程序的推送通知并获取其内容?

This is a long shot, but are there any public (or private) API's that allow us to read existing push notifications on an iOS device? For example, can an app running in the background pole the system every X seconds to determine if the device has received a push notification from the Stack Exchange app and get it's contents?

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

The thought here is there are some services (such as the Ring Video Doorbell) that do not yet have public REST APIs. But when there is motion detected on the Ring camera, it sends a push notification. Similar to the popular IFTTT service, this app would pole for that notification on the device and then do something based on criteria set by the user.

我想至少必须有一个私有 API,因为 Apple 会在通知中心显示设备最近的通知.

I imagine there has to at least be a private API since Apple shows the device's recent notifications in the Notification Center.

推荐答案

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

Even if it was possible to use an unsupported API that violated app security, the contents of the push notification are encrypted and you may not be able to read the contents.

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

However, Apple's Developer site has information on relaying and interacting with other app's push notifications over bluetooth for a bluetooth ANCS.

Apple 通知中心服务 (ANCS) 的目的是为了提供蓝牙配件(通过蓝牙连接到 iOS 设备)蓝牙低功耗链接)一种简单方便的方式来访问许多在 iOS 设备上生成的各种通知."

"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 批准的用于与其他应用进行交互并将推送通知从其他应用转发到蓝牙设备的方法.

This may not be applicable to you, but it is Apple's approved method for interacting with, and relaying push notifications from other apps to bluetooth devices.

这篇关于用于管理推送通知的 iOS API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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