What are the location based trigger capabilities of an app clip?
Asked on 2024-07-31
1 search
App Clips can utilize location-based triggers to provide users with relevant experiences based on their current location. This is achieved through the CoreLocation framework, which allows apps to request and manage location data. Here are some key points about location-based triggers and capabilities for App Clips:
-
CoreLocation API: App Clips can use the CoreLocation API to get latitude and longitude updates whenever the device moves or to receive state change events when spatial conditions are met or unmet. This is facilitated by the
CLLocationUpdateandCLMonitorobjects, which present an async sequence interface for easy integration (What’s new in location authorization). -
Service Sessions: App Clips can create and hold
CLServiceSessionobjects around features that depend on location data. These sessions help manage the lifecycle of location-based features, ensuring that the app can continue to function correctly even if it is backgrounded or terminated (What’s new in location authorization). -
Authorization Management: App Clips need to request location authorization from users. This can be done using methods like
requestWhenInUseAuthorization, which can transition the app from a "not determined" state to either "when in use" or "denied" states. The app can also request full precision or approximate location access based on the user's preferences (What’s new in location authorization). -
Layered Features: Different components of an App Clip can create their own service sessions based on their specific needs. This allows for a more modular and efficient use of location services, where each feature can independently manage its location data requirements (What’s new in location authorization).
-
Foreground and Background Handling: Location-based features in App Clips can continue to function when the app is in the background, as long as the appropriate service sessions are held. This ensures that ongoing activities, like tracking a workout, can persist even if the app is not actively in use (What’s new in location authorization).
Relevant Sessions
These capabilities allow App Clips to provide seamless and contextually relevant experiences based on the user's location, enhancing the overall utility and engagement of the app.

Explore object tracking for visionOS
Find out how you can use object tracking to turn real-world objects into virtual anchors in your visionOS app. Learn how you can build spatial experiences with object tracking from start to finish. Find out how to create a reference object using machine learning in Create ML and attach content relative to your target object in Reality Composer Pro, RealityKit or ARKit APIs.

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.

What’s new in privacy
At Apple, we believe privacy is a fundamental human right. Learn about new and improved permission flows and other features that manage data in a privacy-preserving way, so that you can focus on creating great app experiences.
