{"id":132580,"date":"2023-03-20T14:00:28","date_gmt":"2023-03-20T14:00:28","guid":{"rendered":"https:\/\/developer.apple.com\/news\/?id=qpqf1gru"},"modified":"2023-03-20T14:00:28","modified_gmt":"2023-03-20T14:00:28","slug":"10-questions-with-the-live-activities-team","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2023\/03\/20\/10-questions-with-the-live-activities-team\/","title":{"rendered":"10 questions with the Live Activities team"},"content":{"rendered":"<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2023\/03\/10-questions-with-the-live-activities-team.jpg\" data-hires=\"false\" alt><\/div>\n<p>With Live Activities, your app can provide up-to-date, glanceable information \u2014 like weather updates, a plane\u2019s departure time, or how long it\u2019ll be until dinner is delivered \u2014 right on the Lock Screen. What\u2019s more, thanks to lively features like the Dynamic Island on iPhone 14 Pro and iPhone 14 Pro Max, Live Activities can also be a lot of fun.<\/p>\n<p>Apple evangelists, designers, and engineers came together at Ask Apple to answer your questions about Live Activities and the Dynamic Island. Here are a few highlights from those conversations, including guidance about sizing and styling, when to dismiss a Live Activity, and why widgets and Live Activities are different (except when they\u2019re not).<\/p>\n<h3>How do I update a Live Activity without using Apple Push Notification service (APNs)? <\/h3>\n<p>Your app can use a pre-existing background runtime functionality, such as Location Services, to provide Live Activity updates as you see fit. You can also use BGProcessingTask and background pushes to provide less frequent updates to your Live Activity. Keep in mind that these background tasks aren\u2019t processed immediately by the system. You can read more below:<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/ActivityKit\/displaying-live-data-with-live-activities\" class=\"icon icon-after icon-chevronright\">Displaying live data with Live Activities<\/a><\/p>\n<h3>The 4-hour default to dismiss a Live Activity is too long for my use case. What are the guidelines for dismissing a Live Activity after it ends? <\/h3>\n<p>When ending a Live Activity, you can provide an <code>ActivityUIDismissalPolicy<\/code> to tell the system when to dismiss your UI. Alternatively, you can choose to dismiss the Live Activity immediately or after a certain time has passed.<\/p>\n<h3>How can my app detect when someone dismisses a Live Activity?<\/h3>\n<p>Your app should use the <code>activityStateUpdates<\/code> async sequence to observe state changes for each Live Activity.<\/p>\n<h3>When an app is force quit, is the associated Live Activity dismissed?<\/h3>\n<p>Live Activity life cycles aren\u2019t tied to the host app\u2019s process, so they\u2019ll stay if the app is force quit. Your widget extension\u2019s life cycle is also separate. It\u2019s entirely possible that different instances of the widget extension are called to render views for the same Live Activity, so it\u2019s important not to store any state locally in the widget extension.<\/p>\n<h3>How do Live Activities and widgets differ?<\/h3>\n<p>Live Activities and widgets both provide glanceable information at a moment\u2019s notice. Live Activities are great for displaying situational information related to an ongoing task that someone initiated. Good examples include food deliveries, workouts, and flight departure times. Widgets can provide glanceable information that\u2019s always relevant. Good examples include to-do lists, this week\u2019s weather forecast, or how close someone is to closing their rings on Apple Watch. <\/p>\n<p>While both Live Activities and widgets rely on WidgetKit to lay out their UI, they\u2019re structured a bit differently. Live Activities are a single view that updates programmatically, while widgets consist of a timeline of preconstructed views.<\/p>\n<h3>Should my Live Activity attempt to change the background color of the Dynamic Island?<\/h3>\n<p>The Dynamic Island is most immersive when you don\u2019t provide background color or imagery \u2014 think of it purely as a canvas of foreground view elements. More design guidance is provided in the Human Interface Guidelines.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/design\/human-interface-guidelines\/components\/system-experiences\/live-activities\" class=\"icon icon-after icon-chevronright\">Human Interface Guidelines &#8211; Live Activities<\/a><\/p>\n<h3>Do Live Activities support interactive buttons? <\/h3>\n<p>Live Activities on the Lock Screen and in the Dynamic Island don\u2019t support interactive buttons or other controls. Including buttons in your Live Activity could confuse someone into thinking they\u2019re able to interact with the view. For this reason, you should avoid displaying anything in your UI that resembles a button. <\/p>\n<p>The best user experience exists within your app, which is why all interaction with a Live Activity results in opening your app. A Live Activity\u2019s Lock Screen presentation and expanded presentation can include multiple links into your app, so you can provide different destinations, depending on the context of your Live Activity.<\/p>\n<h3>Are Live Activities the only way to support the Dynamic Island? <\/h3>\n<p>Your app can implement other system services, such as CallKit and Now Playing, that display system UI in the Dynamic Island. However, Live Activities are the only way for your app to provide its own UI in the Dynamic Island. <\/p>\n<h3>Is it possible to add animations to the Dynamic Island?<\/h3>\n<p>While there\u2019s no support for arbitrary animations in your Live Activity views, your app can change how a Live Activity\u2019s content updates from one state to the next. Read more in the \u201cAnimate content updates\u201d section of the article below.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/ActivityKit\/displaying-live-data-with-live-activities\" class=\"icon icon-after icon-chevronright\">Displaying live data with Live Activities<\/a><\/p>\n<h3>Where can I find more documentation about Live Activities? <\/h3>\n<p>The ActivityKit documentationprovides a wealth of information about implementing Live Activities, including how to update and end a Live Activity using APNs. In addition, the Human Interface Guidelinesoffer design guidance and recommended sizes for the various presentations. You can also find some inspiration in the Food Truck sample project from WWDC22.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/design\/human-interface-guidelines\/components\/system-experiences\/live-activities\" class=\"icon icon-after icon-chevronright\">Human Interface Guidelines &#8211; Live Activities<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/ActivityKit\/displaying-live-data-with-live-activities\" class=\"icon icon-after icon-chevronright\">Displaying live data with Live Activities<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/ActivityKit\/updating-and-ending-your-live-activity-with-activitykit-push-notifications\" class=\"icon icon-after icon-chevronright\">Updating and ending your Live Activity with ActivityKit push notifications<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/ActivityKit\" class=\"icon icon-after icon-chevronright\">ActivityKit<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/WidgetKit\" class=\"icon icon-after icon-chevronright\">WidgetKit<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Live Activities, your app can provide up-to-date, glanceable information \u2014 like weather updates, a plane\u2019s departure time, or how long it\u2019ll be until dinner is delivered \u2014 right on the Lock Screen. What\u2019s more, thanks to lively features like the Dynamic Island on iPhone 14 Pro and iPhone 14 Pro Max, Live Activities can [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":132581,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-132580","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apple-developer-news"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/132580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=132580"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/132580\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/132581"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=132580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=132580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=132580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}