gpt4 book ai didi

ios - WCSession:是否可以取消排队的消息?

转载 作者:行者123 更新时间:2023-11-28 16:15:00 24 4
gpt4 key购买 nike

有没有办法取消WCSessionsendMessage(_:replyHandler:errorHandler:)方法发送的消息?

来自documentation :

Messages are queued serially and delivered in the order in which you sent them.

最佳答案

没有。这种类型的转移是不可取消的,因为

  • 操作系统会立即将任何sendMessage 数据发送到可达 对应方

    Use the [sendMessage] method to transfer data to a reachable counterpart. These methods are intended for immediate communication between your iOS app and WatchKit extension.

    Data sent using the [sendMessage], and transferCurrentComplicationUserInfo: methods has a higher priority and is transmitted right away.

  • 操作系统没有提供专门取消消息的机制

    唯一具有取消方法的WCSession对象是WCSessionUserInfoTransferWCSessionFileTransfer,因为低优先级transferUserInfotransferFile 数据不会立即发送,而是在操作系统确定的最佳时间发送。

关于ios - WCSession:是否可以取消排队的消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39194716/

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