
With Live Activities, your app tin supply up-to-date, glanceable accusation — similar upwind updates, a plane’s departure time, oregon however agelong it’ll beryllium until meal is delivered — close connected the Lock Screen. What’s more, acknowledgment to lively features similar the Dynamic Island connected iPhone 14 Pro and iPhone 14 Pro Max, Live Activities tin besides beryllium a batch of fun.
Apple evangelists, designers, and engineers came unneurotic astatine Ask Apple to reply your questions astir Live Activities and the Dynamic Island. Here are a fewer highlights from those conversations, including guidance astir sizing and styling, erstwhile to disregard a Live Activity, and wherefore widgets and Live Activities are antithetic (except erstwhile they’re not).
How bash I update a Live Activity without utilizing Apple Push Notification work (APNs)?
Your app tin usage a pre-existing inheritance runtime functionality, specified arsenic Location Services, to supply Live Activity updates arsenic you spot fit. You tin besides usage BGProcessingTask and inheritance pushes to supply little predominant updates to your Live Activity. Keep successful caput that these inheritance tasks aren’t processed instantly by the system. You tin work much below:
Displaying unrecorded information with Live Activities
The 4-hour default to disregard a Live Activity is excessively agelong for my usage case. What are the guidelines for dismissing a Live Activity aft it ends?
When ending a Live Activity, you tin supply an ActivityUIDismissalPolicy to archer the strategy erstwhile to disregard your UI. Alternatively, you tin take to disregard the Live Activity instantly oregon aft a definite clip has passed.
How tin my app observe erstwhile idiosyncratic dismisses a Live Activity?
Your app should usage the activityStateUpdates async series to observe authorities changes for each Live Activity.
When an app is unit quit, is the associated Live Activity dismissed?
Live Activity beingness cycles aren’t tied to the big app’s process, truthful they’ll enactment if the app is unit quit. Your widget extension’s beingness rhythm is besides separate. It’s wholly imaginable that antithetic instances of the widget hold are called to render views for the aforesaid Live Activity, truthful it’s important not to store immoderate authorities locally successful the widget extension.
How bash Live Activities and widgets differ?
Live Activities and widgets some supply glanceable accusation astatine a moment’s notice. Live Activities are large for displaying situational accusation related to an ongoing task that idiosyncratic initiated. Good examples see nutrient deliveries, workouts, and formation departure times. Widgets tin supply glanceable accusation that’s ever relevant. Good examples see to-do lists, this week’s upwind forecast, oregon however adjacent idiosyncratic is to closing their rings connected Apple Watch.
While some Live Activities and widgets trust connected WidgetKit to laic retired their UI, they’re structured a spot differently. Live Activities are a azygous presumption that updates programmatically, portion widgets dwell of a timeline of preconstructed views.
Should my Live Activity effort to alteration the inheritance colour of the Dynamic Island?
The Dynamic Island is astir immersive erstwhile you don’t supply inheritance colour oregon imagery — deliberation of it purely arsenic a canvas of foreground presumption elements. More plan guidance is provided successful the Human Interface Guidelines.
Human Interface Guidelines: Live Activities
Do Live Activities enactment interactive buttons?
Live Activities connected the Lock Screen and successful the Dynamic Island don’t enactment interactive buttons oregon different controls. Including buttons successful your Live Activity could confuse idiosyncratic into reasoning they’re capable to interact with the view. For this reason, you should debar displaying thing successful your UI that resembles a button.
The champion idiosyncratic acquisition exists wrong your app, which is wherefore each enactment with a Live Activity results successful opening your app. A Live Activity’s Lock Screen presumption and expanded presumption tin see aggregate links into your app, truthful you tin supply antithetic destinations, depending connected the discourse of your Live Activity.
Are Live Activities the lone mode to enactment the Dynamic Island?
Your app tin instrumentality different strategy services, specified arsenic CallKit and Now Playing, that show strategy UI successful the Dynamic Island. However, Live Activities are the lone mode for your app to supply its ain UI successful the Dynamic Island.
Is it imaginable to adhd animations to the Dynamic Island?
While there’s nary enactment for arbitrary animations successful your Live Activity views, your app tin alteration however a Live Activity’s contented updates from 1 authorities to the next. Read much successful the “Animate contented updates” conception of the nonfiction below.
Displaying unrecorded information with Live Activities
Where tin I find much documentation astir Live Activities?
The ActivityKit documentation provides a wealthiness of accusation astir implementing Live Activities, including however to update and extremity a Live Activity utilizing APNs. In addition, the Human Interface Guidelines connection plan guidance and recommended sizes for the assorted presentations. You tin besides find immoderate inspiration successful the Food Truck illustration task from WWDC22.
Human Interface Guidelines: Live Activities
Displaying unrecorded information with Live Activities
Starting and updating Live Activities with ActivityKit propulsion notifications