gpt4 book ai didi

ios - 如果当前目标有可用的 watch 应用程序版本,如何 checkin 代码?

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

我在一个 View 中工作,我应该根据应用程序是否有 Watch 版本对其进行自定义。

我知道我可以使用:

[[WCSession defaultSession] isWatchAppInstalled]

(但这不是我想要的,因为用户可以在 Apple Watch 中卸载该应用程序,但 iOS 应用程序仍然可以安装 Watch 版本)

还有:

[[WCSession defaultSession] isPaired] 不是我的情况。

最佳答案

实际上 isWatchAppInstalled 是处理这种情况的正确方法。

如文档所述:

The user can choose to install only a subset of available apps on Apple Watch. The value of this property is true when the Watch app associated with the current iOS app is installed on the user’s Apple Watch or false when it is not installed.

https://developer.apple.com/documentation/watchconnectivity/wcsession/1615623-iswatchappinstalled

该属性不会查看包内部以查看 Watch 应用程序是否可用。只有在当前配对的 Apple Watch 上安装了 Watch 应用程序时,它才会返回 true。如果用户从 watch 中删除 Watch App,它将返回 false。

关于ios - 如果当前目标有可用的 watch 应用程序版本,如何 checkin 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59672642/

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