gpt4 book ai didi

swift - 我想通过 BLE 设备使用 ANCS 回复 WhatsApp 通知

转载 作者:行者123 更新时间:2023-11-28 13:37:23 26 4
gpt4 key购买 nike

如何回复来自 ANCS 的通知?有没有可能?在 ANCS 的帮助下,我能够在我的 BLE 设备上获得所有通知。现在我想在 ANCS 的帮助下过滤通知类型后回复通知。

因此,如果通知属于消息或 Whatsapp 类别,那么我将通过我们的 BLE 设备发送一些静态消息。

ANCS 有可能吗?如果是那么怎么办?如果不是,那么还有其他方法可以做到这一点吗?

最佳答案

无法使用 ANCS 发送特定的文本回复通知。

如果通知包含 EventFlagPositiveAction 的值和 EventFlagNegativeAction然后设备可以使用 positive 发出执行通知操作negative值(value)。

在 iOS 8 之后设备可以使用 NotificationAttributeIDPositiveActionLabelNotificationAttributeIDNegativeActionLabel尝试检索一些描述操作的文本(例如,来电的“接听”或“拒绝”)。

来自documentation :

The actual actions performed by the NP on behalf of the NC are determined by the NP and vary depending on the iOS notification they are performed on. For example, performing a positive action on an Incoming Call notification may answer it, while performing a negative action may decline it.

The NC must neither assume nor try to guess in advance the exact action performed on an iOS Notification, because these actions are based upon information unavailable to it, as well as other factors such as the ANCS version implemented by the NP. The NP guarantees that positive and negative actions are associated with results that do not surprise the user.

我不知道蓝牙设备可以使用任何方法通过 WhatsApp 发送消息;这将需要应用程序中的特定支持。

您可以使用消息访问配置文件 (MAP) 阅读 SMS/iMessage 消息,但 iOS 设备 do not support sending messages via MAP -

22.11.4 Message Access Profile (MAP)

Every accessory that is compatible with a device and supports MAP must:

  • Support Message Notification as described in Section 4.1 of the Bluetooth Message Access Profile Specification, version 1.0.
  • Register for notifications immediately after the connection is established, as described in Section 4.5 in the Message Access Profile Specification, version 1.0.
  • Not expect the TEL property to be present in the originator VCARD (the properties N and FN will be included). See Section 3.1.3 in the Message Access Profile Specification, version 1.0.
  • Not provide a user interface for sending messages. Devices do not support sending messages using MAP.

关于swift - 我想通过 BLE 设备使用 ANCS 回复 WhatsApp 通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56448917/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com