iOS8 Core Location Updates

So I recently had a job that required me to set up Core Location Services for iOS, which I haven’t tinkered with since Apple released iOS 8, and as it turns out they made a few pretty important changes in their implementation.

Unlike previous version, iOS 8 will now require an authentication before start location services. Although this is a pretty simple task, and only necessitates a few extra lines of code, it can slow down online casino your coding quite a bit, particularly if your expecting the Core Locations service to work the same way it did in iOS 7.

There are two steps that need to be done to get Core Location working in iOS 8:

  1. The first thing that you’ll need to do is to add two lines of code to the instantiation of your Core Location Manager.We show the implementation below:
if (nil == self.localLocationManager){// iOS 7 Core Locationself.localLocationManager = [[CLLocationManageralloc] init];self.localLocationManager.delegate = self;// We only need to authorize for iOS 8if ([self.localLocationManagerrespondsToSelector:@selector(requestAlwaysAuthorization)])[self.localLocationManagerrequestWhenInUseAuthorization];

}

 

There are two kinds of authorization that you can request, WhenInUse and Always. WhenInUse authentication will allow the app to receive location updates only when the app is in the foreground. Always authorization will allow the app to receive location updates both when the app is in the foreground and in the background.

You will need Always authorization to use the following location types :

  • Significant Location Change
  • Boundary Crossing (Geofences)
  • Background Location Updates (e.g. Fitness, Navigation apps)
  • iBeacons
  • Visited Locations (iOS 8+)
  • Deferred Location Updates

All these location types have the power to wake the app from suspended or terminated when a location event occurs.

  1. The second thing that you’ll need is add the plist keys for the authorization that you need to add to your app.
  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysUsageDescription

Screen Shot 2015-01-07 at 10.34.49 PM

Both of these keys take a string which is a description of why you need location services, which will be displayed by the UIAlertView that asks the user to allow your app permission to use the Core Location Services, so phrase it carefully.

You’ll need to include the key for the corresponding services that you’ll choose to implement, but I tend to include both (it can’t hurt after all).

bestessay4u.net walk-through: front rank service to receive essays instantly & at the right time

bestessay4u.net walk-through: front rank service to receive essays instantly & at the right time

Are you feeling nervous about how to carry out difficult educational papers? bestessay4u.net offers you the best ideas that really help everyone grab top grades. Continue reading bestessay4u.net walk-through: front rank service to receive essays instantly & at the right time

Just how to Compose

Periodicals may be valuable for writing exercise. I suggest that in addition to writing in a language, the pupil is usually understanding how precisely to compose a quick essay for the initial moment. Language composition is a certain sort of writing which is normally related to everyone programs. In this fashion you can locate guidance and support in order for you to really enrich your composing abilities immediately and obtain the test rating that you want. Continue reading Just how to Compose

Media

Please make sure whatever applications you’re downloading are safe and sound. To be sure it downloads the right info, you will require to ensure that your films are named correctly. You could also utilize a MicroSD card, also a file manager program, or the world wide web to sideload files. Continue reading Media