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:

  1. 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.
  2. 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's Info.plist.
  3. 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.
  4. 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:

  1. 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.
  2. Pagination in Server API:

    • The MapKit server API now supports pagination, allowing for searches that return a large number of results, organized into pages.
  3. 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.