how things changed in location sdk?
Generated on 8/8/2024
1 search
Changes in Location SDK
CoreLocation Authorization
In the session What’s new in location authorization, several updates were introduced to simplify and enhance the way apps handle location authorization:
-
Declarative Authorization Goals:
- The new
CLServiceSession
struct allows developers to declare their authorization goals more clearly. This shift from a procedural to a declarative model simplifies the code and makes it more robust. - The session object helps manage authorization states and interactions with CoreLocation APIs.
- The new
-
Implicit Service Sessions:
- CoreLocation can now treat the act of iterating live updates or monitoring events as implicitly holding a
CLServiceSession
. This means that apps can handle authorization by simply iterating updates, reducing the need for explicit code. - This behavior is enabled by default but can be disabled by setting the
NSLocationRequireExplicitServiceSession
key in the app'sInfo.plist
.
- CoreLocation can now treat the act of iterating live updates or monitoring events as implicitly holding a
-
Layered Features:
- Developers are encouraged to make each feature self-sufficient in terms of service sessions. This means different components of an app can independently create the service sessions they need without coordinating with other components.
- This approach helps manage complex apps with multiple features requiring different levels of location access.
-
Diagnostic Properties:
- A new system of diagnostic properties provides a complete contextual understanding of the app's current authorization state and the function of any CoreLocation API objects.
MapKit Enhancements
In the session Unlock the power of places with MapKit, several improvements were highlighted:
-
Enhanced Search Capabilities:
- MapKit now supports searching for a wider variety of places, including music venues, skateparks, castles, physical features like rivers or mountain ranges, and specific address components like city or postal code.
- Searches can be restricted to specific bounding regions, making it easier to focus on relevant areas.
-
Pagination in Server API:
- The MapKit server API now supports pagination, allowing for searches that return a large number of results, organized into pages.
-
Place ID and Place Cards:
- Place IDs can be used to reference specific locations, and place cards can display detailed information about these places.
- These features can be embedded in web pages and used to enhance app search results and provide valuable context to users.
These updates collectively make it easier for developers to manage location services and enhance the user experience with more powerful and flexible location-based features.
Unlock the power of places with MapKit
Discover powerful new ways to integrate maps into your apps and websites with MapKit and MapKit JS. Learn how to save and reference unique places using Place ID. Check out improvements to search that make it more efficient to find relevant places. Get introduced to the new Place Card API that lets you display rich information about places so customers can explore destinations right in your app. And, we’ll show you quick ways to embed maps in your website with our simplified token provisioning and Web Embed API.
What’s new in location authorization
Location authorization is turning 2.0. Learn about new recommendations and techniques to get the authorization you need, and a new system of diagnostics that can let you know when an authorization goal can’t be met.