LocationManager 'didExitRegion' did not receive iBeacon Xcode title

I am working with iBeacon iOS. I started coding with Xcode 5.1. At that time, all delegates are called. But while I was updating my Xcode to 6.0.1 to support the app in iOS 8, the following delegation method is not called (tested on device):

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

      

This works great in iOS 7. Can anyone suggest me any possible solution for me? Thanks in advance.

+3
ios objective-c xcode ibeacon


source to share


4 answers


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 update your app background image. I am running this in iOS 8 and it works like a charm.

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

+2


source to share


In iOS 8, requesting host permissions is slightly different. You must ask to either allow your app to use location services while using your app, or always.



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

+2


source to share


After checking

Go to settings

> Privacy

> Location services

> Your app

>Always

+1


source to share


Add this to Location Manager for iOS8:

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

      

Cheers: D

+1


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics