1

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.

rihekopo
  • 3,241
  • 4
  • 34
  • 63

1 Answers1

2

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.

Community
  • 1
  • 1
Jannis
  • 99
  • 7
  • Do you think it will work on iOS 7 also? It should work on iOS7-8 – rihekopo Dec 25 '14 at 18:50
  • 1
    The NSLocationWhenInUseUsageDescription key is only required on iOS 8, but updating Parse to the latest version should get it to work properly on iOS 7 – Jannis Dec 25 '14 at 18:52