rihekopo
rihekopo

Reputation: 3350

Can't retrieve geopoint with geoPointForCurrentLocationInBackground

I'm trying to retrieve the current user's current geopoint, but nothing happens when I call the geoPointForCurrentLocationInBackground:. I can't log the NSLog's from the block, however the other NSLog appears in the console.

- (IBAction)whereCurrentUser:(id)sender {

    [PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error) {
        if (geoPoint) {

            NSLog(@"GEOPOINT %@", geoPoint);

        }

        else

        {
              NSLog(@"ERROR");
        }
    }];
    NSLog(@"BUTTON TAPPED");
}

Do I need to implement something else? The documentation is quite clear therefore I can't figure out what could be the problem.

Upvotes: 1

Views: 236

Answers (1)

Jannis
Jannis

Reputation: 99

There's a solution posted on Parse.com PFGeoPoint.geoPointForCurrentLocationInBackground not doing anything. Basically update Parse to the latest version and add the NSLocationWhenInUseUsageDescription key to your Info.plist, this is a change made in iOS 8 and is needed whenever you want to use an users location within your app.

Upvotes: 2

Related Questions