ActivityKit

RSS for tag

Help people keep track of tasks and events that they care about with Live Activities on the Lock Screen, the Dynamic Island, and in StandBy.

Posts under ActivityKit tag

120 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

LiveActivity on device with Dynamic Island
I am developing a live activity for my app and am running into issues on devices with dynamic islands. The live activity will randomly get in a state where it displays a spinner and does not update. For devices without dynamic islands, the activity works perfectly fine. I have tried breaking down the views to determine the root cause, but at times it seems very random. These are all TestFlight builds as we are currently developing the feature. I have tried using the console app and looking at the various processes that have been called out in other threads and cannot see any actual errors being logged. Looking for any pointers on how to pinpoint the root cause of this issue.
0
0
156
2w
Triggering a Live Activity from a Widget-Based App Intent
Hello everyone, I have an app leveraging SwiftData, App Intents, Interactive Widgets, and a Control Center Widget. I recently added Live Activity support, and I’m using an App Intent to trigger the activity whenever the model changes. When the App Intent is called from within the app, the Live Activity is created successfully and appears on both the Lock Screen and in the Dynamic Island. However, if the same App Intent is invoked from a widget, the model is updated as expected, but no Live Activity is started. Here’s the relevant code snippet where I call the Live Activity: ` await LiveActivityManager.shared.newSessionActivity(session: session) And here’s how my attribute is defined: struct ContentState: Codable, Hashable { var session: Session } } Is there any known limitation or workaround for triggering a Live Activity when the App Intent is initiated from a widget? Any guidance or best practices would be greatly appreciated. Thank you! David
1
0
204
2w
Live Activities - Missing Entitlement
I've built an app that supports live activities, but when trying to build and deploy I'm getting the error: Provisioning profile "iOS Team Provisioning Profile doesn't include the com.apple.developer.live-activity entitlement." Looking in Xcode - under signing and provisions, there is no "Live Activity" option to select. Looking in the developer portal, similarly under Certificates, Identifiers & Profiles, there is no "Live Activity" option. I've added com.apple.developer.live-activity to my entitlements file for both my widget and my main app target, and added NSSupportsLiveActivities to my info.plist files. I'm building on Xcode Version 16.0 Any ideas on how to fix this? Super confused! Thanks in advance!
0
0
203
3w
How can I be notified when my app is in foreground and server start an live activity by push notification
My app will be woken when Activity.pushToStartTokenUpdates delivered the new token. But I want to know how can I get the activity.pushTokenUpdates when my server start an live activity via push notification, because without the activity.pushTokenUpdates, my server can't deliver update information after start the live activity. For now, I check the activities when my app switch foreground/background. But how can I be notified when my app is in foreground and server start an live activity by push notification. I've tried "content-available": 1 in LA's payload aps, but I also can't be notified in the didReceiveRemoteNotification in appDelegate.
0
0
162
Dec ’24
Live Activity update push token
For devices running iOS 18 and iPadOS 18 or later, you can add input-push-token: 1 to your payload to start a Live Activity and receive a new push token. After you receive a new push token, you can use it to send updates to a Live Activity. I read from https://developer.apple.com/documentation/ActivityKit/starting-and-updating-live-activities-with-activitykit-push-notifications#Start-new-Live-Activities-with-ActivityKit-push-notifications that I can start a live activity from CUSTOM SERVER by the start token I get from MyApp.Does that paragraph means my CUSTOM SERVER can receive a new token from aps? If not, how can update the live activity started by Push-Notification when MyApp doesn't alive? And what "input-push-token: 1 " can do, when I put it in the payloads?
2
0
279
Dec ’24
ActivityKit crashes when requesting to create a Live Activity
Our app occasionally crashes when creating a Live Activity using ActivityKit. Crash log analysis indicates a wild pointer issue originating within ActivityKit. The crash appears to be linked to the coexistence of multiple Live Activities. Could this be a compatibility issue with ActivityKit? We would appreciate any guidance or potential workarounds to resolve this issue. Looking forward to your response. Thread 0 Crashed: 0 ActivityKit 0x000000023023d034 0x230235000 + 32820 ( + 13792) 1 ActivityKit 0x000000023023d014 0x230235000 + 32788 ( + 13760) 2 Combine 0x00000001ac5bd168 0x1ac5b5000 + 33128 ( + 292) 3 Combine 0x00000001ac5c0658 0x1ac5b5000 + 46680 ( + 24) 4 Combine 0x00000001ac5d1714 0x1ac5b5000 + 116500 ( + 204) 5 Combine 0x00000001ac5c8da0 0x1ac5b5000 + 81312 ( + 24) 6 Combine 0x00000001ac5e8e98 0x1ac5b5000 + 212632 ( + 2520) 7 Combine 0x00000001ac5d1a4c 0x1ac5b5000 + 117324 ( + 24) 8 Combine 0x00000001ac68316c 0x1ac5b5000 + 844140 ( + 56) 9 Combine 0x00000001ac5d4a4c 0x1ac5b5000 + 129612 ( + 176) 10 Combine 0x00000001ac5bd43c 0x1ac5b5000 + 33852 ( + 392) 11 Combine 0x00000001ac5b7198 0x1ac5b5000 + 8600 ( + 24) 12 Combine 0x00000001ac5ead74 0x1ac5b5000 + 220532 ( + 712) 13 Combine 0x00000001ac5e2320 0x1ac5b5000 + 185120 ( + 24) 14 Combine 0x00000001ac5bfe74 0x1ac5b5000 + 44660 ( + 488) 15 Combine 0x00000001ac5b81b8 0x1ac5b5000 + 12728 ( + 24) 16 Combine 0x00000001ac5b8804 0x1ac5b5000 + 14340 (Just.receive(subscriber:) + 424) 17 Combine 0x00000001ac5f7a7c 0x1ac5b5000 + 273020 (Publishers.Merge.receive(subscriber:) + 820) 18 Combine 0x00000001ac5d9850 0x1ac5b5000 + 149584 (PublisherBox.receive(subscriber:) + 108) 19 Combine 0x00000001ac5b8154 0x1ac5b5000 + 12628 (AnyPublisher.receive(subscriber:) + 64) 20 Combine 0x00000001ac5dc9cc 0x1ac5b5000 + 162252 ( + 548) 21 Combine 0x00000001ac5dc764 0x1ac5b5000 + 161636 (Publishers.HandleEvents.receive(subscriber:) + 620) 22 Combine 0x00000001ac5d9850 0x1ac5b5000 + 149584 (PublisherBox.receive(subscriber:) + 108) 23 Combine 0x00000001ac5b8154 0x1ac5b5000 + 12628 (AnyPublisher.receive(subscriber:) + 64) 24 Combine 0x00000001ac5d92e8 0x1ac5b5000 + 148200 (Publishers.FlatMap.receive(subscriber:) + 416) 25 Combine 0x00000001ac5dc9cc 0x1ac5b5000 + 162252 ( + 548) 26 Combine 0x00000001ac5d9850 0x1ac5b5000 + 149584 (PublisherBox.receive(subscriber:) + 108) 27 Combine 0x00000001ac5b8154 0x1ac5b5000 + 12628 (AnyPublisher.receive(subscriber:) + 64) 28 Combine 0x00000001ac5f062c 0x1ac5b5000 + 243244 (Publishers.CompactMap.receive(subscriber:) + 572) 29 Combine 0x00000001ac5d9850 0x1ac5b5000 + 149584 (PublisherBox.receive(subscriber:) + 108) 30 Combine 0x00000001ac5b8154 0x1ac5b5000 + 12628 (AnyPublisher.receive(subscriber:) + 64) 31 Combine 0x00000001ac5e64e4 0x1ac5b5000 + 201956 (Publishers.SetFailureType.receive(subscriber:) + 552) 32 Combine 0x00000001ac5d92e8 0x1ac5b5000 + 148200 (Publishers.FlatMap.receive(subscriber:) + 416) 33 Combine 0x00000001ac5dc9cc 0x1ac5b5000 + 162252 ( + 548) 34 Combine 0x00000001ac5d9850 0x1ac5b5000 + 149584 (PublisherBox.receive(subscriber:) + 108) 35 Combine 0x00000001ac5b8154 0x1ac5b5000 + 12628 (AnyPublisher.receive(subscriber:) + 64) 36 Combine 0x00000001ac5f062c 0x1ac5b5000 + 243244 (Publishers.CompactMap.receive(subscriber:) + 572) 37 Combine 0x00000001ac5d9850 0x1ac5b5000 + 149584 (PublisherBox.receive(subscriber:) + 108) 38 Combine 0x00000001ac5b8154 0x1ac5b5000 + 12628 (AnyPublisher.receive(subscriber:) + 64) 39 Combine 0x00000001ac5bdd68 0x1ac5b5000 + 36200 (Publishers.ReceiveOn.receive(subscriber:) + 812) 40 Combine 0x00000001ac5f1e10 0x1ac5b5000 + 249360 (Publisher.sink(receiveCompletion:receiveValue:) + 304) 41 ActivityKit 0x00000002302594a0 0x230235000 + 148640 ( + 6064) 42 ActivityKit 0x0000000230258c18 0x230235000 + 146456 ( + 3880) 43 ActivityKit 0x0000000230258410 0x230235000 + 144400 ( + 1824) 44 ActivityKit 0x0000000230258124 0x230235000 + 143652 ( + 1076) 45 ActivityKit 0x0000000230258080 0x230235000 + 143488 ( + 912) 46 ActivityKit 0x000000023026d280 0x230235000 + 230016 ( + 4228) 47 ActivityKit 0x000000023026d39c 0x230235000 + 230300 ( + 4512) 48 libswiftDispatch.dylib 0x00000001ac59e7f4 0x1ac59d000 + 6132 ( + 28) 49 libswiftDispatch.dylib 0x00000001ac5a5a90 0x1ac59d000 + 35472 ( + 16) 50 libswiftDispatch.dylib 0x00000001ac59f97c 0x1ac59d000 + 10620 ( + 188) 51 libswiftDispatch.dylib 0x00000001ac59fa90 0x1ac59d000 + 10896 ( + 28) 52 libswiftDispatch.dylib 0x00000001ac59f5ec 0x1ac59d000 + 9708 ( + 28) 53 libdispatch.dylib 0x00000001ab37feac 0x1ab37c000 + 16044 ( + 20) 54 libdispatch.dylib 0x00000001ab38f428 0x1ab37c000 + 78888 ( + 56) 55 libswiftDispatch.dylib 0x00000001ac59ef38 0x1ac59d000 + 7992 ( + 180) 56 libswiftDispatch.dylib 0x00000001ac59e0dc 0x1ac59d000 + 4316 ( + 56) 57 libswiftDispatch.dylib 0x00000001ac59ec48 0x1ac59d000 + 7240 ( + 396) 58 libswiftDispatch.dylib 0x00000001ac59e188 0x1ac59d000 + 4488 (OS_dispatch_queue.sync(execute:) + 164) 59 ActivityKit 0x000000023026be70 0x230235000 + 224880 ( + 3228) 60 ActivityKit 0x000000023026b400 0x230235000 + 222208 ( + 556) 61 ActivityKit 0x00000002302d10b4 0x230235000 + 639156 ( + 25780) 62 ActivityKit 0x00000002302d0cd0 0x230235000 + 638160 ( + 24784) 63 ActivityKit 0x00000002302d0b94 0x230235000 + 637844 ( + 24468) 64 xxxx 0x0000000100919638 specialized static LiveActivityManager.startActivity(title:) + 169528 (LiveActivityManager.swift:96)
1
0
184
Dec ’24
LiveActivity UI not showing in flutter ios app
I'm implementing iOS Live Activities in my Flutter app using the live_activities package. While the activity seems to be created (I can get the activity token, and clicking the Dynamic Island opens the app), the LiveActivity UI does not show up as expected. Logs: The following errors/warnings appear in the logs: Not updating lastKnownShmemState in CFPrefsPlistSource<0x6000006bc7e0> (Domain: group.powerdock.sessionactivity, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): 34 -> 33 What Works: The activity token is created successfully. Clicking the Dynamic Island opens my app. What Does Not Work: The LiveActivity UI does not display on the lock screen or elsewhere.
1
0
228
Dec ’24
Live Activity Dissappearing
Hello, I am experiencing an issue with the Live Activity feature in my application. Despite extensive debugging efforts, the problem persists, and I would greatly appreciate your assistance. Here are the key details of the issue: We are not using APNS; everything related to Live Activities is handled locally within the app. The Live Activity displays task details, including: Task title, icon and A label functioning as a timer that shows the remaining time in seconds for the task. The Live Activity appears as expected when the app is opened. However, when the app is sent to the background, the Live Activity does not appear consistently. It disappears unexpectedly in some random instances. I have tried various debugging methods, including: Ensuring the activity is correctly created and updated as per the Apple Documentation. Verifying the ActivityAttributes and ActivityContentState configurations. Testing with different app lifecycle events to determine when the issue occurs. Despite these efforts, the issue remains unresolved, and the cause is unclear. The app behavior seems inconsistent, as the Live Activity sometimes remains visible and at other times disappears when the app is backgrounded. I would greatly appreciate your help in understanding and addressing this issue. Specifically: Are there any system-level constraints or conditions that could cause a Live Activity to terminate when the app is backgrounded? Are there best practices or configurations to ensure the persistence of locally managed Live Activities? Can you suggest additional debugging techniques or tools that could help identify the root cause? Thank you for your time and support. Please let me know if further information or logs are needed to assist in troubleshooting
1
0
199
Dec ’24
Live Activity Dissappearing
Hello, I am experiencing an issue with the Live Activity feature in my application. Despite extensive debugging efforts, the problem persists, and I would greatly appreciate your assistance. Here are the key details of the issue: We are not using APNS; everything related to Live Activities is handled locally within the app. The Live Activity displays task details, including: Task title, icon and A label functioning as a timer that shows the remaining time in seconds for the task. The Live Activity appears as expected when the app is opened. However, when the app is sent to the background, the Live Activity does not appear consistently. It disappears unexpectedly in some random instances. I have tried various debugging methods, including: Ensuring the activity is correctly created and updated as per the Apple Documentation. Verifying the ActivityAttributes and ActivityContentState configurations. Testing with different app lifecycle events to determine when the issue occurs. Despite these efforts, the issue remains unresolved, and the cause is unclear. The app behavior seems inconsistent, as the Live Activity sometimes remains visible and at other times disappears when the app is backgrounded. I would greatly appreciate your help in understanding and addressing this issue. Specifically: Are there any system-level constraints or conditions that could cause a Live Activity to terminate when the app is backgrounded? Are there best practices or configurations to ensure the persistence of locally managed Live Activities? Can you suggest additional debugging techniques or tools that could help identify the root cause? Thank you for your time and support. Please let me know if further information or logs are needed to assist in troubleshooting STEPS TO REPRODUCE Download and Install the Owaves App from the App Store. Create a Live Activity: Open the app and create an activity for the current time on Today. Example: If the current time is 9:30 AM, create an activity with a time range such as 9:00 AM - 10:00 AM to ensure it is live. Enable Live Activity: Tap on the newly created activity to open the Event Details page. Scroll to the bottom of the page and locate the toggle switch labeled "Live Activity". Switch the toggle to the ON position to enable the Live Activity. Background the App: Send the app to the background. Check the Lock Screen: Swipe down to enable iOS' Lock Screen and check for the Live Activity from the Owaves app. Repeat the Steps: If the Live Activity appears on the Lock Screen initially, repeat steps 3-5 multiple times. Eventually, you will encounter instances where the Live Activity does not appear on the Lock Screen, despite following the same process
2
0
272
Dec ’24
How to start and automatically update/end a local live activity?
I'm implementing a timer feature and facing the issue that the live activity I'm starting just continues showing after the timer is complete. The body of the live activity widget is more or less: ActivityConfiguration(for: WhendyWidgetAttributes.self) { context in VStack { Text( context.state.timerEndDate, style: .timer ) // if Date.now < timerEndTime { Text("Done") } self.expandedView(state: context.state) } } … Ideally I could get the activity to show something else when it is done but I don't know how to get it to re-evaluate it's body once the end time is reached. I create the activity with let activity = try ActivityKit.Activity.request( attributes: attributes, content: .init( state: .init(timerEndDate: timerEndDate), staleDate: timerEndDate ), pushType: nil ) Can I schedule the activity to do a refresh it's body (and reevaluating Date.now) once the timerEndDate is reached? Considered Approaches trying staleDate However, the activity never shows that it has become stale. Would it be expected that it shows the stale-ness? scheduling dismissal I also thought about starting and immediately stopping the activity with a delayed dismissal, but unfortunately it seems this is limited to a 4 hour window, and I'd like longer timers too. remote updates I understand I could use remote notifications to update the live activity, but I'd really like to keep things local as all the functionality is locally plannable. Background Tasks I understand these don't run reliably or at a predictable time. A Timer in the app that updates the content I think this would only update the activity while the app is in foreground.
0
0
196
Nov ’24
How to disable Dynamic Island expansion/interaction in SwiftUI Live Activity?
I have implemented a Live Activity with Dynamic Island support for my charging app. Currently, the Dynamic Island expands when tapped, but I want to disable this interaction completely. Here's my current implementation: **dynamicIsland: { context in DynamicIsland { // Expanded Regions DynamicIslandExpandedRegion(.leading) { // Leading expanded content } DynamicIslandExpandedRegion(.trailing) { // Trailing expanded content } DynamicIslandExpandedRegion(.bottom) { // Bottom expanded content } } compactLeading: { // Compact leading view content } compactTrailing: { // Compact trailing view content } minimal: { // Minimal view content } .keylineTint(Color.clear) }**
0
0
221
Nov ’24
Live Acitivities - ProgressView problem
Hello i ve implemented progressview and updating the state via push notification. the progress view wants closedrange which i followed but whenever i get update, the progress value resets to beginning my range is like : Date.now..endDate but i dont get it, lets assume that i get the date from database and initialized already then how the code will understand that what progress value will be as current ? it has to be something like i suppose : startDate..Date.now..endDate thanks
0
0
263
Nov ’24