gpt4 book ai didi

ios - 检查 watch 应用程序是否处于最前面状态

转载 作者:行者123 更新时间:2023-11-30 12:12:56 24 4
gpt4 key购买 nike

有什么办法可以知道 watch 应用程序是否位于最前面(是否来自 iPhone)?问题是,当 watch 应用程序处于最前面的状态时,它会访问
applicationWillResignActive()applicationDidEnterBackground() ExtensionDelegate 方法。

那么如何检查 watch 应用是否处于最前面状态?

最佳答案

在 iPhone 上,您可以检查 WCSessionisReachable 值。

根据WCSession documentation , isReachable 在以下情况下为 true:

A paired and active Apple Watch is in range, the corresponding WatchKit extension is running, and the WatchKit extension’s isReachable property is true.

关于ios - 检查 watch 应用程序是否处于最前面状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45820452/

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