Using Core Location in Apple WatchKit

后端 未结 3 861
半阙折子戏
半阙折子戏 2021-01-06 06:09

I\'m currently developing an apple watch extension. Anybody knows if the current location is provided by iPhone or Watch itself? I can\'t find any information about this and

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-06 06:53

    According to Apple's Dev Documentation:

    The best solution for performing any long-running tasks is to let your iOS app perform the task instead. For example, instead of starting location services in your WatchKit extension, start it in your iOS app. Your iOS app can gather the needed data and put it in a shared app group so that your extension can access it later. Use the openParentApplication:reply: method to initiate tasks and receive a reply or use a shared group container to communicate details between your iOS app and WatchKit extension. For information about how to handle communication between your iOS app and WatchKit extension, see Communicating Directly with Your Containing iOS App.

    P.S. I am working on similar app.

提交回复
热议问题