gpt4 book ai didi

ios - 使用 openParentApplication : and handleWatchKitExtensionRequest: to send location updates to Watch App not working

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

我正在使用 openParentApplication:handleWatchKitExtensionRequest:请求并发送一个 NSNumber 对象,该对象包含来自核心位置 locationManager:didUpdateLocation: 的值方法。我这样做是为了让我的 watchkit 应用程序不必担心使用 Core Location,并且我可以使用我已经在 iOS 应用程序中编写的所有逻辑。对我的 watchkit 扩展的回调似乎工作正常,我在“回复:”回调中得到了回复。

但是,在我手动点击模拟器中的应用程序图标之前,我从未从核心位置获得任何真实数据。然后我开始从核心位置获取真实数据,并且我的 watch 套件界面更新为正确的数据。

这只是模拟器的限制吗?

最佳答案

我需要使用 requestAlwaysAuthorization而不是 requestWhenInUseAuthorization .这样做让我能够以我想要的方式获得位置更新。

关于ios - 使用 openParentApplication : and handleWatchKitExtensionRequest: to send location updates to Watch App not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29380718/

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