Widgets & Live Activities

RSS for tag

Discuss how to manage and implement Widgets & Live Activities.

WidgetKit Documentation

Posts under Widgets & Live Activities subtopic

Post

Replies

Boosts

Views

Activity

How to track a Live Activity started via push when the app is terminated and hasn't been relaunched from long time?
Hi all, I'm currently implementing Live Activities using ActivityKit and facing a real-world limitation that I hope the community (or Apple) can clarify. 🔹 I can successfully start a Live Activity via APNs push (event: "start") even when the app is terminated — the Live Activity appears as expected on the Lock Screen and Dynamic Island. However, I need to update that Live Activity using the name I assigned in the push payload (e.g., match-123). This requires calling: Airship.channel.trackLiveActivity(activity, name: activity.attributes.matchID) …or equivalent code in native implementations to associate the activity with its push token. ❓The problem: If the user has never launched the app, or hasn't opened it after the Live Activity was started via push, then there’s no chance for the app to run this tracking code. So: ✅ Live Activity starts fine via APNs ❌ I can't track the activity and register it for future push updates (by name) until the app is launched ❌ Therefore, I can't update the Live Activity without knowing the token-name mapping 🔍 My question: Is there any way to programmatically track or associate a Live Activity (started via push) with a name for APNs updates, without requiring the app to launch? Or put differently: Can the system automatically track the name → token mapping if the activity is started via push? Is there any way (via entitlement, plist config, or system event) to allow registering the activity in the background (without user launch)? 💡 Notes: I already use pushType: .token and NSSupportsLiveActivitiesFrequentUpdates Live Activity content is fine; only the ability to send future updates is blocked without initial app launch Using Airship SDK for push + activity tracking, but the question is general to iOS + ActivityKit behavior Any insight on how apps like FotMob, Uber, or sports apps handle this situation would be really helpful! Thanks in advance.
1
0
203
Jul ’25
How to opt out of tinting widget content on visionOS
During the WWDC Session called "Design widgets for visionOS" the presenter says: You can choose whether the background of your widget participates in tinting. If you opted out, for example to preserve a photo or illustration, make sure it still looks good alongside the selected color palette. Unfortunately, this session has no example code. Can someone point me to the correct way to do this? Is there a modifier we can use on views? (reposting this in the correct topic/subtopic)
3
0
141
Aug ’25
Can custom user images be displayed as backgrounds on Lock Screen?
Background I'm developing an iOS app with Live Activities that allows users to select custom background images. While these custom images display correctly in widgets, they fail to appear in Live Activities on both Lock Screen and Dynamic Island, despite successful image loading and data transfer. Technical Details iOS Version: Testing on iOS 17.2+ Image Storage: Using App Group shared container for image sharing between main app and widget extension Image Loading: Successfully confirmed via logs - images load correctly with proper dimensions UI Framework: SwiftUI with ActivityKit What Works ✅ Custom images display correctly in Home Screen widgets ✅ Built-in bundled images work in Live Activities ✅ Image data successfully transfers via App Group shared container ✅ Image loading logs show successful UIImage creation with correct dimensions What Doesn't Work ❌ Custom user images don't display in Live Activities (Lock Screen) ❌ Custom user images don't display in Dynamic Island ❌ Images appear as black/gray background despite successful loading Code Implementation I've tried multiple approaches: 1. SwiftUI Image approach: Image(uiImage: customImage) .resizable() .aspectRatio(contentMode: .fill) 2. containerBackground API approach: .containerBackground(for: .widget) { Image(uiImage: customImage) .resizable() .aspectRatio(contentMode: .fill) } 3. UIKit wrapper approach: struct UIImageViewWrapper: UIViewRepresentable { let image: UIImage func makeUIView(context: Context) -> UIImageView { let imageView = UIImageView(image: image) imageView.contentMode = .scaleAspectFill return imageView } func updateUIView(_ uiView: UIImageView, context: Context) { uiView.image = image } } Observations Images load successfully (confirmed via console logs) File paths are correct and accessible Same image loading code works perfectly in widgets When testing with UIKit approach, a red prohibition icon appears, suggesting system restrictions Questions Is there a technical limitation preventing user-provided images from displaying in Live Activities? Are there specific security restrictions for Live Activity backgrounds that don't apply to widgets? Is this behavior intentional based on Apple's design guidelines for Live Activities? What's the recommended approach for custom backgrounds in Live Activities? Apple Documentation Reference I found this guidance in "10 questions with the Live Activities team": "The Dynamic Island is most immersive when you don't provide background color or imagery — think of it purely as a canvas of foreground view elements." However, this seems to be design guidance rather than a technical restriction, and it doesn't specifically address Lock Screen Live Activities. Expected Behavior Custom user images should display as backgrounds in Live Activities, similar to how they work in widgets. Current Workaround I've implemented a color extraction system that generates gradients based on the dominant colors of user images, but users specifically want to see their actual images. Has anyone successfully implemented custom user images as Live Activity backgrounds, or can Apple clarify the intended behavior and limitations? Thank you for any insights!
0
0
90
Aug ’25
watchOS 26 Control Widget AppEnum Localize issue
I’m implementing a Control Widget for watchOS 26 Beta 5, using .promptsForUserConfiguration() so that users can select an option from an enum when adding the widget. The overall functionality works fine, but when users configure the option, the enum’s corresponding text is not properly localized. My enum is defined like this: static var caseDisplayRepresentations: [XXXType: DisplayRepresentation] { [ XX1: .init(title: .init("text1", table: "xxx")), XX2: .init(title: .init("text2", table: "xxx")), ] } After the configuration is completed and the Control Widget appears in the Control Center or Smart Stack, the text is displayed correctly. Same code on iOS work perfect.
0
0
56
Aug ’25
Activity.request MACH_Exception EXC_BAD_ACCESS KERN_INVALID_ADDRESS
When I use the Activity.request method to start the Dynamic Island widget, there have been continuous crash reports online, Could you please provide some ideas on how to fix this crash? Thanks! Crash backtraces: 0ActivityKitblock_copy_helper.101 (in ActivityKit)+21416 1CombinePublishers.FlatMap.Outer.receive(B.Output) (in Combine)+296 2Combineprotocol witness for Subscriber.receive(A.Input) in conformance Publishers.FlatMap<A, B>.Outer<A1> (in Combine)+20 3CombinePublishers.HandleEvents.Inner.receive(A.Output) (in Combine)+204 4Combineprotocol witness for Subscriber.receive(A.Input) in conformance Publishers.HandleEvents<A>.Inner<A1> (in Combine)+20 5CombineFilterProducer.receive(B) (in Combine)+2508 6Combineprotocol witness for Subscriber.receive(A.Input) in conformance FilterProducer<A, B, C, D, E> (in Combine)+20 7Combinepartial apply for closure #4 (C) in Publishers._Merged.request(Subscribers.Demand) (in Combine)+52 8CombinePublishers._Merged.guardedApplyDownstream<A>((C)) (in Combine)+180 9CombinePublishers._Merged.receive(A, Int) (in Combine)+400 10CombinePublishers._Merged.Side.receive(A) (in Combine)+20 11CombineJust.Inner.request(Subscribers.Demand) (in Combine)+692 12Combineprotocol witness for Subscription.request(Subscribers.Demand) in conformance Just<A>.Inner<A1> (in Combine)+20 13CombinePublishers._Merged.receive(subscription: Subscription, _: Int) (in Combine)+496 14CombinePublishers._Merged.Side.receive(subscription: Subscription) (in Combine)+20 15CombineJust.receive<A>(subscriber: A1) (in Combine)+420 16CombinePublishers.Merge.receive<A>(subscriber: A1) (in Combine)+380 17CombinePublisherBox.receive<A>(subscriber: A1) (in Combine)+104 18CombineAnyPublisher.receive<A>(subscriber: A1) (in Combine)+60 19CombinePublishers.RemoveDuplicates.receive<A>(subscriber: A1) (in Combine)+220 20CombinePublishers.HandleEvents.receive<A>(subscriber: A1) (in Combine)+300 21CombinePublisherBox.receive<A>(subscriber: A1) (in Combine)+104 22CombineAnyPublisher.receive<A>(subscriber: A1) (in Combine)+60 23CombinePublishers.FlatMap.receive<A>(subscriber: A1) (in Combine)+416 24CombinePublishers.RemoveDuplicates.receive<A>(subscriber: A1) (in Combine)+220 25CombinePublisherBox.receive<A>(subscriber: A1) (in Combine)+104 26CombineAnyPublisher.receive<A>(subscriber: A1) (in Combine)+60 27CombinePublishers.CompactMap.receive<A>(subscriber: A1) (in Combine)+440 28CombinePublisherBox.receive<A>(subscriber: A1) (in Combine)+104 29CombineAnyPublisher.receive<A>(subscriber: A1) (in Combine)+60 30CombinePublishers.SetFailureType.receive<A>(subscriber: A1) (in Combine)+420 31CombinePublishers.FlatMap.receive<A>(subscriber: A1) (in Combine)+416 32CombinePublishers.RemoveDuplicates.receive<A>(subscriber: A1) (in Combine)+220 33CombinePublisherBox.receive<A>(subscriber: A1) (in Combine)+104 34CombineAnyPublisher.receive<A>(subscriber: A1) (in Combine)+60 35CombinePublishers.CompactMap.receive<A>(subscriber: A1) (in Combine)+440 36CombinePublisherBox.receive<A>(subscriber: A1) (in Combine)+104 37CombineAnyPublisher.receive<A>(subscriber: A1) (in Combine)+60 38CombinePublishers.ReceiveOn.receive<A>(subscriber: A1) (in Combine)+660 39CombinePublisher.sink(receiveCompletion: (Subscribers.Completion<A.Failure>), receiveValue: (A.Output)) (in Combine)+316 40ActivityKitblock_copy_helper.101 (in ActivityKit)+33364 41ActivityKitblock_copy_helper.101 (in ActivityKit)+26716 42ActivityKitblock_copy_helper.101 (in ActivityKit)+53192 43ActivityKitblock_copy_helper.101 (in ActivityKit)+52408 44ActivityKitblock_destroy_helper.25 (in ActivityKit)+1140 45ActivityKitblock_destroy_helper.62 (in ActivityKit)+8220 46ActivityKitblock_destroy_helper.62 (in ActivityKit)+9364 47libswiftDispatch.dylibpartial apply for thunk for @callee_guaranteed () -> (@out A, @error @owned Error) (in libswiftDispatch.dylib)+24 48libswiftDispatch.dylibthunk for @callee_guaranteed () -> (@out A, @error @owned Error)partial apply (in libswiftDispatch.dylib)+12 49libswiftDispatch.dylibclosure #1 () in closure #1 (()) in OS_dispatch_queue._syncHelper<A>(fn: (()), execute: (), rescue: (Error)) (in libswiftDispatch.dylib)+188 50libswiftDispatch.dylibpartial apply for thunk for @callee_guaranteed () -> () (in libswiftDispatch.dylib)+24 51libswiftDispatch.dylibthunk for @escaping @callee_guaranteed () -> () (in libswiftDispatch.dylib)+24 52libdispatch.dylib__dispatch_client_callout (in libdispatch.dylib)+16 53libdispatch.dylib__dispatch_lane_barrier_sync_invoke_and_complete (in libdispatch.dylib)+52 54libswiftDispatch.dylibimplicit closure #2 (()) in implicit closure #1 (OS_dispatch_queue) in OS_dispatch_queue.asyncAndWait<A>(execute: ()) (in libswiftDispatch.dylib)+188 55libswiftDispatch.dylibpartial apply for implicit closure #2 (()) in implicit closure #1 (OS_dispatch_queue) in OS_dispatch_queue.sync<A>(execute: ()) (in libswiftDispatch.dylib)+72 56libswiftDispatch.dylibOS_dispatch_queue._syncHelper<A>(fn: (()), execute: (), rescue: (Error)) (in libswiftDispatch.dylib)+400 57libswiftDispatch.dylibOS_dispatch_queue.asyncAndWait<A>(execute: ()) (in libswiftDispatch.dylib)+136 58libswiftDispatch.dylibOS_dispatch_queue.sync<A>(execute: ()) (in libswiftDispatch.dylib)+60 59ActivityKitblock_destroy_helper.62 (in ActivityKit)+3272 60ActivityKitblock_destroy_helper.62 (in ActivityKit)+724 61ActivityKit___swift_store_extra_inhabitant_indexTm (in ActivityKit)+24928 62ActivityKit___swift_store_extra_inhabitant_indexTm (in ActivityKit)+23900 63 XXXApp static LiveActivityService.request() ......
1
0
32
Aug ’25
ManagedSettings doesn't block Live Activities in the Dynamic Island
When using the ManagedSettings API to block apps everything is blocked as expected (the app itself, Notifications, Live Activities on the Lock Screen etc) except for Compact Live Activities of those apps (that are shown in the Dynamic Island). I feel the expected behavior would be to block also the Compact Live Activities. Our use case: In Spoilerblock we want to prevent users from being exposed to spoilers before they've had time to watch for example a sports game. Current workaround: Right now the best we can do is to ask the user to disable Live Activities for apps that could expose results, to not risk being exposed to a spoiler.
3
0
36
Aug ’25
connection to service created from an endpoint
The execution of the shortcut command is abnormal. An App Intents was created through xcode, a test example was written, and an exception was executed. error: couldn`t communicate with a helper application. log: Shortcut <WFWorkflow: 0x600003008b40, name: Test, actions: 1> failed with error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service created from an endpoint" UserInfo={NSDebugDescription=connection to service created from an endpoint, WFActionIndex=0}. -[WFBackgroundShortcutRunner callWorkflowRunningCompletionBlockWithResult:] Workflow Did Finish: Calling Completion Block -[WFBackgroundShortcutRunner listener:shouldAcceptNewConnection:]_block_invoke XPC connection invalidated -[WFBackgroundShortcutRunnerStateMachine invalidateWithReason:] connection invalidated/interrupted while finishing shortcut or exiting runner. Exiting should already be in process, not transitioning. -[WFBackgroundShortcutRunner unaliveProcess]_block_invoke_2 Exiting process
0
0
50
Aug ’25
Cannot install any widgets. Crash in SBHRippleSimulation.
I cannot install any widgets on my simulator, even the system provided ones. I just finished removing all dev software from my machine and reinstalling only Xcode 16.3. Springboard always crashes: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0xfffffffffffffff8 Exception Codes: 0x0000000000000001, 0xfffffffffffffff8 VM Region Info: 0xfffffffffffffff8 is not in any region. REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> UNUSED SPACE AT END Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [5015] Triggered by Thread: 0 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 SpringBoardHome 0x10f0f8e50 -[SBHRippleSimulation clear] + 74 1 SpringBoardHome 0x10f0f8f0f -[SBHRippleSimulation createRippleAtGridCoordinate:strength:] + 73 2 libdispatch.dylib 0x12de8e5b6 _dispatch_client_callout + 6 3 libdispatch.dylib 0x12de78a33 _dispatch_continuation_pop + 859 4 libdispatch.dylib 0x12de8baae _dispatch_source_invoke + 2178 5 libdispatch.dylib 0x12de8388e _dispatch_main_queue_drain + 732 6 libdispatch.dylib 0x12de835a4 _dispatch_main_queue_callback_4CF + 31 7 CoreFoundation 0x12c25fd5c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 8 CoreFoundation 0x12c25a7c8 __CFRunLoopRun + 2511 9 CoreFoundation 0x12c2599f1 CFRunLoopRunSpecific + 536 10 GraphicsServices 0x118d35c09 GSEventRunModal + 137 11 UIKitCore 0x15732a580 -[UIApplication _run] + 875 12 UIKitCore 0x15732f707 UIApplicationMain + 123 13 SpringBoard 0x10fe9c4e2 SBSystemAppMain + 7639 14 ??? 0x10ada43da ??? 15 dyld 0x10fd7d530 start + 3056 So it's crashing when it tries to make the little animation when a widget is dropped. I removed all the runtimes, every cache and preference I could find, emptied the trash, rebooted (to release any open file descriptors), and reinstalled Xcode. Nothing helped.
0
0
115
Aug ’25
iOS 26 - Widget not updated with respect to main app's system preferred language
Hi, My iOS app's home screen widget content was implemented to base on the preferred language of my main app (e.g. my app has the following preferred language options with this order English, Japanese, Traditional Chinese, Korean, Simplify Chinese). Say the main app is currently using English as their preferred language, I can change the preferred language in the iOS Settings -> Apps -> My App -> Preferred Language. My widget's content will respect to the preferred language option that I selected with only exception if I switch back to English language and my Widget's content won't get updated. The Main app content is always update with respect to the selected preferred language. My app and widget is working without any issue in iOS 18. Other things that I had discovered during my testing under iOS 26, the "first" language appeared in my preferred language always being the issue (e.g. if the first language is Japanese , once I change to other languages and than switch back to Japanese, my widget content won't respect to this but the main app content are ok). Any one has a similar issues regarding the preferred language?
1
0
86
Aug ’25
Live Activity doesn't update as frequently as it should
I'm developing an app which will show the driver ETA and rendering the progress bar of the current ETA. Intuitively the backend server sends the push notification every 3 seconds through firebase cloud message service to APNS so that the device can refresh the dynamic island smoothly. But the live activity doesn't refresh as frequently as the backend service does. It should refresh every 3 seconds but it turns out like refresh 30 ~ 60 seconds, sometimes it didn't refresh at all. any body facing the same?
1
0
62
Aug ’25
AppIntents not working in Release
We have some AppIntents we are POCing and when we make a Release build, they no longer appear in the system. These AppIntents live in a Framework compiled and linked with the core app. We believe that this is related to Mergable Libraries. We have confirmed that the meta data for the framework still contains a list of all of the actions and their mangled symbols. The mangled symbols however now live in the app binary (confirmed by building Release with DEBUG_INFORMATION_FORMAT = dwarf) If we move the AppIntent code into the app target, things once again work as expected. Is there a flag we need to set, or is moving the code into the app target the only workaround? Thank you!
3
0
254
Aug ’25
Should `input-push-token` be added to all live-activity based payloads?
I'm struggling to understand what the impact of this flag is. Docs only say: 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. But things were working fine for iOS 17. Right? Does it somehow make the OS emit update tokens faster/more successfully? Should I include in all start, update, end events?
1
0
120
Aug ’25
Can I Present AlarmKit's UI in Expanded Dynamic Island when its fired?
Can I Present AlarmKit's Alarm UI in Expanded Dynamic Island that I implement with SwiftUI when its fired? not System AlarmUI, but my the view that I implemented. I've implemented Dynamic Island properly, and tried various scenarios but I can't find out the way to present AlarmKit UI in Expanded Dynamic Island when it is fired. I don't know why, but, sometimes, it is presented in Expanded Dynamic Island UI which is I Implemented. But when I try lots of times, It is presented in System AlarmKit UI not my SwiftUI View. Can you please tell me how can I present my SwiftUI Expanded Dynamic Island when it is fired? Sincerely
0
0
33
Aug ’25
Push notifcation-driven live activity not starting
Hi, I'm having this issue that I have have not been able to figure out as I've gone through a checklist and it seems I have everything in place, but im sending my pushToStartTokenUpdates token to a server and im able to test starting a live activity via CURL where it shows my push token going through and even my test payload but after a while I get this issue in my logs where it fails to find a live activity Push notifications are set up, im sending my token to APN and im even able to start live activities locally.
2
0
137
Sep ’25
What is the purpose of the `alert` field for live activities payloads?
Does the alert only serve the following purposes: required for start events require for any event that needs to alert the user (with sound or having the live activity show in expanded presentation) while its content DO NOT matter. Only the presence of the field and its attributes matter. The only time its content matter are when the receiving device is an Apple Watch. Is that correct?
1
0
95
Sep ’25
Live Activity budget exceeded
When sending multiple push to start notifications to start a live activities in a short time frame, after around 10 pushes live activities are no longer being started. Device logs show the following entry: Push-to-start budget exceeded for com.att.tlv.myatt::pushToStart; not starting activity What can be done to be able to open more live activities via push-to-start in a short time frame (increase the push-to-start budget)? Can this be related to the development environment and it will not happen on production? NSSupportsLiveActivitiesFrequentUpdates is already set to YES
2
0
135
3w
Unable to open new live activities after opening 5 live activities and clearing them
After opening 5 live activities using live activity push-to-start push notifications, I clear them from lock screen. From this point forward I am unable to open new live activities. Device log shows: Could not create a new activity from push notification: ActivityKit.ActivityAuthorizationError.targetMaximumExceeded How can I handle such use case? shouldn't the count of opened live activities be reduced once the user clears the live activities? is this a bug?
1
0
125
3w