ios - 接收iOS系统(例如短信)通知

标签 ios notifications bluetooth-lowenergy core-bluetooth ancs

我看到其他人也问过同样的问题,例如iOS system alertsreceiving all alerts ,没有得到答复。

我在第二个代码中尝试了该代码,但它只收到该应用程序的所有警报。所以如果例如我在运行此应用程序的设备上收到短信提醒,我只收到以下内容:

Notification found with:

 name:     _UIApplicationWillAddDeactivationReasonNotification
 object:   <UIApplication: 0x14dd01a40>
 userInfo: {
"_UIApplicationDeactivationReasonUserInfoKey" = 10;
}
Notification found with:

 name:     UIApplicationWillResignActiveNotification
 object:   <UIApplication: 0x14dd01a40>
 userInfo: (null)

所以这只是应用程序上的 SMS 对话框的效果,而不是 SMS 通知。

据我所知,在 iOS 应用程序沙箱中无法接收所有系统通知(例如 Facebook、WhatsApp、Twitter、短信、来电、未接来电等)。获得这些的唯一方法是通过可以请求 ANCS 的 BLE 外围设备。

这是正确的吗?

最佳答案

你是对的。请求这些通知的唯一方法是通过 BLE ANCS 协议(protocol),与 iOS 设备通信的外围设备可以订阅该协议(protocol)。

我能想到的一个非最重要的原因是避免人们能够通过本质上“抓取”并以恶意方式累积这些通知来进行任何形式的监控。

关于ios - 接收iOS系统(例如短信)通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29780501/

相关文章:

flutter - 如何在 Flutter 中与 BLE 设备进行绑定(bind)

ios - 在 BLE 中读取和写入数据以快速打开/关闭 LED

ios - 我如何实现与苹果集群模式相同的行为(NSString 和 NSCFString)

ios - 在 MPMoviePlayerController 中全屏播放视频问题

ios - SQLite 和 Objective C - WHERE LIKE 语句错误

ios - 具有混合类型(字符串和 NSMutableArray)的 swift 4 post 通知 userInfo

powershell - 今天的日期和密码的到期日期少于 14 天?

ios - iOS 上的应用程序可以实现 BLE 设备信息服务中的固件版本字符串特征吗

ios - firebase ios snapshot.childrenCount 返回默认值 0 而不是数据库值

安卓通知 : compatibility with APIs