Foursquare LogoFoursquare Developers Logo

Preparing your app for iOS 14+

With the release of iOS 14, Apple has made a few changes that may impact how you use the Pilgrim SDK. Specifically, the changes introduced are:

  • IDFA Permission (delayed until early 2021)
  • Updated Location Permission Prompts
  • Temporary Precise Location

Below you'll find some more information on the changes and how you should handle them in your app.

IDFA Permission (delayed until early 2021)

What’s New?
In the new IDFA flow, an app can request access to the IDFA via a prompt to the user. If the user opts to allow tracking, the app will be able to access the IDFA via the same property on the ASIdentifierManager Class as before. The user also has a global “Allow Apps to Request to Track” switch that they can toggle to suppress all IDFA prompts moving forward.

With the removal of the “Limit Ad Tracking” switch, Apple has also deprecated the isAdvertisingTrackingEnabled method which allowed developers to check if the IDFA was available to collect. Developers will now need to switch over to the new AppTrackingTransparency framework’s trackingAuthorizationStatus method to see the permission state of the IDFA. They will then use the requestTrackingAuthorization method to prompt for permission to collect the IDFA.

Requesting Access to the IDFA

To display the App Tracking Transparency authorization prompt for accessing the IDFA, you'll first need to update your Info.plist file to add the NSUserTrackingUsageDescription key - as well as a message describing why you need access to the IDFA.

<key>NSUserTrackingUsageDescription</key>
<string>This Id helps us serve relevant ads that are tailored to you</string>
Screenshot showing where to add NUSerTrackingUsageDescription

To present the authorization prompt, call requestTrackingAuthorizationWithCompletionHandler: and handle the authorization status

Screenshot showing where to add NUSerTrackingUsageDescription

The prompt, along with your usage description, will appear as shown below:

Screenshot showing where to add NUSerTrackingUsageDescription

Updated Location Permission Prompts

What’s New?
iOS 14 introduces an updated permission prompt which includes a map and an additional toggle in the top left-hand corner of the map. This toggle allows users to turn on or off the “Precise Location” authorization. When switching between the two, the user is presented with two different maps. When the toggle is “ON,” the map shows the user’s exact location via the traditional “blue dot.” When the toggle is “OFF,” the map shows a zoomed-out view with a larger circle spanning a few miles surrounding the user.

Screenshot showing precise location

Checking Location Authorization

What’s New?
In order to identify that a location is approximate, Apple has introduced an accuracyAuthorization property on the CLLocationManager that contains two states which identify whether your app has either reducedAccuracy or fullAccuracy permission enabled. The below screenshot shows how to handle either state;

Screenshot showing how to handle accuracy authorizations

Temporary Precise Location

What’s New?
Apple has also introduced a requestTemporaryFullAccuracyAuthorization method. This can be used when the user has opted out or denied "Precise Location". In addition to being able to request temporary access to precise location, you can add a custom "purpose string" that allows you to further surface why Precise Location is necessary.

Screenshot showing how to request temporary precise location

More info

For a more in depth take on iOS 14 and it's changes with respect to the Pilgrim SDK, check out this blog post.