I need to fetch the user current location for the WatchKit App in watchOS 2. How do I do this?
Open the Find My app. Choose the Devices tab. Select your Apple Watch to see its location on the map.
Another place to check is on the watch in settings/privacy/Location Services and make sure this is turned on and scroll down to apple watch workout and select while using the app.
On your iPhone, in the Watch app, go to: My Watch (tab) > Weather > Default City > choose Current Location (or a specific location from those that have been added to the Weather app on your iPhone, if preferred).
If you use the Find My app on iPhone, iPad, or Mac, then you have a similar tool for locating people with your Apple Watch. On watchOS 6 or later, the app is called Find People and on watchOS 5 or earlier, it's Find My Friends. But both apps do the same thing and can help you track down your loved ones.
The other answers are incorrect. You can request location directly on the watch for watch OS2. The available method is called requestLocation
. It allows you to request a single location update.
E.g.
#import <CoreLocation/CoreLocation.h>
@interface className : WKInterfaceController<CLLocationManagerDelegate>
Then where you want to request location:
self.locationManager = [CLLocationManager new];
self.locationManager.delegate = self;
[self.locationManager requestWhenInUseAuthorization];
[self.locationManager requestLocation];
Then you will get a single callback in one of the following CLLocationManagerDelegate
methods.
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
// Callback here with single location if location succeeds
}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
// Error here if no location can be found
}
See the WWDC15 video "What's New in Core Location" - https://developer.apple.com/videos/wwdc/2015/?id=714
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With