Thampuran
Thampuran

Reputation: 654

locationManager 'didExitRegion' not getting called iBeacon Xcode

I'm working with my iBeacon iOS app. I started coding with Xcode 5.1. Ath that time every delegates get called. But while I updated my Xcode to 6.0.1 to support the app in iOS 8, the following delegate method is not getting called (tested in device):

-(void) locationManager:(CLLocationManager*)manager 
          didExitRegion:(CLRegion*)region

It is workinng perfectly in iOS 7. Can anyone please suggest me any possible solution for me? Thanks in advance.

Upvotes: 3

Views: 1589

Answers (4)

user1872384
user1872384

Reputation: 7127

Add this to the location manager for iOS8:

// Needed for iOS 8
if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
    [self.locationManager requestAlwaysAuthorization];
}

Cheers :D

Upvotes: 1

Daniel
Daniel

Reputation: 23359

On iOS 8, requesting location permissions is a little different. You must request either to allow your app to use location services while your app is being used or always.

For iBeacons to work in the background, you must request to have permissions to always have feedback from Core Location, so always allow location updates.

Upvotes: 2

user2299177
user2299177

Reputation:

Once check

Go to settings > Privacy > Location services > Your app > Always

Upvotes: 1

Gaurav Govilkar
Gaurav Govilkar

Reputation: 154

Kepp this with your locationmanager instance

  self.locationManager = [[CLLocationManager alloc] init];
    // New iOS 8 request for Always Authorization, required for iBeacons to work!
    if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
        [self.locationManager requestAlwaysAuthorization];
    }

and keep your app background refreshing ON. I am running this in iOS 8 and it is working like a charm.

For more help you can read this article iBeacon http://ibeaconmodules.us/blogs/news/14279747-tutorial-ibeacon-app-development-with-corelocation-on-apple-ios-7-8

Upvotes: 2

Related Questions