Using Core Location in Apple WatchKit

后端 未结 3 818
半阙折子戏
半阙折子戏 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:48

    You can't use CoreLocation from the watchkit extension. You can however use an api to open the parent app (in the background) and ask your parent api for the information. The api is really nice because you can use it with a reply so that you can easily get the information back:

    + (BOOL)openParentApplication:(NSDictionary *)userInfo reply:(void(^)(NSDictionary *replyInfo, NSError *error)) reply;    // launches containing iOS application on the phone
    

提交回复
热议问题