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

'openAppWhenRun' property causing AppIntentsExtension to fail
import AppIntents struct AddTodoIntent: AppIntent { static var title: LocalizedStringResource = "Add Todo" static var openAppWhenRun: Bool = true func perform() async throws -> some IntentResult & ProvidesDialog { .result(dialog: "New todo added successfully.") } } struct ViewTodosIntent:AppIntent { static var title: LocalizedStringResource = "View Todos" func perform() async throws -> some IntentResult & ProvidesDialog { .result(dialog: "Here are your todos...") } } struct TodoAppShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: AddTodoIntent(), phrases: ["\(.applicationName) Add a new todo"], shortTitle: "New Todo", systemImageName: "plus.circle" ) AppShortcut( intent: ViewTodosIntent(), phrases: ["\(.applicationName) Show my todoso"], shortTitle: "Show todos", systemImageName: "plus.app" ) } } when we used, it wrong How did i can do it success?
0
0
114
Oct ’25
Can you include an `alert` with a sound within the `end` event?
Q1. Can you place a sound on an end event? That doesn't seem to work for us Additionally: Q2. Is there any way that after you send the end event, still have the Live Activity remain on the Dynamic Island until the dismissal-date? Currently when an end event is sent, it's abruptly ended from the Dynamic Island without any sound. Users are confused until minutes/hours later they see their Lock Screen.
0
0
155
Oct ’25
Cannot get app into Control Center on physical device.
I want to add my app to Controls, just a button to open the app. The end goal is to put it on a lock screen. However, I can get it to work on the iPhone simulator, but I am unable to get it on my actual device. No warnings or failed build or signing issues. I feel like I have changed and tinkered everything. I feel like my code is correct, so maybe it's an issue of the signing? I am lost. Running the control center stuff through Widgetkit.
0
0
147
Oct ’25
Dose AlarmKit Live Activity not trigger .widgetURL?
Hello, I would like to inquire about a specific behavior I've observed with Live Activities to determine if it is a bug. When our application is closed but the device is in use, an alarm triggers a Live Activity to appear at the top of the screen. However, it seems that tapping the background area of this Live Activity does not trigger the .widgetURL and .onOpenURL Could you please confirm if this is the intended behavior? or should I config another setting for desired action like trigger .onOpenURL? Thank you for your time and assistance. Best regards,
0
0
95
Nov ’25
Inquiry regarding a change in AlarmKit Live Activity presentation behavior (iOS 26.0 vs. 26.1)
Hello, We have observed a change in the presentation behavior of the AlarmKit Live Activity banner when our application is in the foreground, following the update from iOS 26.0 to iOS 26.1. We would like to clarify which behavior is intended. In iOS 26.0: When our application was in the foreground, the AlarmKit Live Activity banner did not present. In iOS 26.1: The AlarmKit Live Activity banner now presents even when our application is in the foreground. Could you please advise on what the correct or desired behavior is for this scenario? Thank you for your clarification.
0
0
123
Nov ’25
How to determine the cause of errors in LiveActivity and DynamicIsland
I have developed a LiveActivity on my product that supports DynamicIsland. Recently, two users encountered this situation while updating the app: LiveActivity was created with a status of. active, but after 100ms, it immediately started displaying as. dimiss. This process was repeated many times until the user restarted their iPhone and the display became normal A user's LiveActivity was successfully created with a status of. active, and the data was updated using the. update method normally; But this user's interface keeps showing a gray component empty state I am unable to obtain useful information regarding the bug encountered in processing. I would like to know how to obtain the reason why the user's LiveActivity has been modified to. dimiss by the iOS system in the face of these situations; How can I obtain useful information to determine the cause of the error when the user interface cannot display data without debugging. Thank you~
0
0
87
Nov ’25
The application crashed on the ios12 system
The iap package typed with macos26 xcode26 crashed on ios12 add WidgetKit and set its Status to "Optional" #if canImport(WidgetKit) import WidgetKit #endif We have already modified the configuration in these two ways. There are no issues on ios13 and above systems, but it won't start on ios12. However, we want to support the lowest version of ios12. How can we solve this problem,The crash might still be the one below dyld: Library not loaded: /System/Library/Frameworks/WidgetKit.framework/WidgetKit Referenced from: /private/var/containers/Bundle/Application/CA01C3C8-5010-4EDC-8089-058A3A4E79E7/bodianplayer.app/bodianplayer Reason: image not found
0
0
164
Nov ’25
Snippet Views don't render consistently, width not always respected
I've created a Snippet for my iOS app which I want to be able to run from the LockScreen via a Shortcuts widget. All works fine except when I run the shortcut and the App Snippet appears, it doesn't always render the SwiftUI view in the same way. Sometimes the width boundaries are respected and sometimes not. I've tested this on iOS 26.1 and iOS 26.2 beta 3 I think this is a bug but it would be great if anyone could see what I might be doing wrong if it's not. Incase it is a bug I've filed a feedback (FB21076429) and I've created a stripped down sample project showing the issue and added screenshots showing the issue. Basic code to reproduce issue: // Intent.swift // SnippetBug import AppIntents import Foundation import SwiftUI struct SnippetEntryIntent: AppIntent { static let title: LocalizedStringResource = "Open Snippet" static let description = IntentDescription("Shows a snippet.") // Don’t open the app – stay in the snippet surface. static let openAppWhenRun: Bool = false func perform() async throws -> some ShowsSnippetIntent { .result(snippetIntent: TestSnippetIntent()) } } struct TestSnippetIntent: SnippetIntent { static let title: LocalizedStringResource = "Snippet Intent" static let description = IntentDescription("Action from snippet.") @MainActor func perform() async throws -> some IntentResult & ShowsSnippetView { .result(view: SnippetView(model: SnippetModel.shared)) } } @MainActor final class SnippetModel { static let shared = SnippetModel() private init() { } } struct SnippetView: View { let model: SnippetModel var body: some View { HStack { Text("Test Snippet with information") Spacer() Image(systemName: "heart") }.font(.headline) } } struct Shortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: SnippetEntryIntent(), phrases: [ "Snippet for \(.applicationName)", "Test Snippet \(.applicationName)" ], shortTitle: "Snippet", systemImageName: "barcode" ) } } You also need these lines in your main App entry point: import AppIntents @main struct SnippetBugApp: App { init() { let model = SnippetModel.shared AppDependencyManager.shared.add(dependency: model) } var body: some Scene { WindowGroup { ContentView() } } } This is correct This is incorrect
0
0
140
Nov ’25
App intent with parameter launches app before taking user input
I built a couple of app intents for macOS, which generally work great. However, I'm struggling with configuring an app intent that takes a parameter, so that it doesn't require the app to launch before presenting people with the list of options. If the app is running and I run the intent in Spotlight, I can see the message defined by the intent's parameterSummary and I can select a parameter from the list of entities. If the app is not running, it is launched first and only then the intent message fully populates in Spotlight and allows parameter selection. What I've tried: Support background or deferred mode in the intent. Conformed the entities to IndexedEntity. Conformed the entity query to EnumerableEntityQuery, implementing suggestedEntities and allEntities. Conformed the entity query to EntityStringQuery. Donated the intent to Spotlight on app launch. Donated the entities to Spotlight on app launch, both using indexSearchableItems and indexAppEntities. Not sure if both are required or if the latter is just a more convenient version of the former. Do I have to conform to or implement something else? Do I need to work with an app intent extension? If so, would I put all app intent code into the extension instead of the main app? Is this a system bug I should file?
0
0
138
Nov ’25
How to Update a Live Activity from a Widget Extension When Local Notifications Are Active?
I’m manipulating some data inside a widget extension, and at the same time there is an active Live Activity (Dynamic Island / Lock Screen). How can I update the Live Activity’s local notification when the data changes? I tried accessing the current activity using Activity.activities, but it seems that this API is not accessible from inside the widget extension. What is the correct way to refresh or update the Live Activity in this case?
0
0
147
Nov ’25
How To Set Custom Icon for Control Center Shortcuts
How do I set a custom icon for an app control that appears in Control Shortcuts (swipe down from iOS) ? Where is the documentation for size and where to put the image, format etc? Thank you. Working Code (sfsymbol) import Foundation import AppIntents import SwiftUI import WidgetKit // MARK: - Open App Control @available(iOS 18.0, *) struct OpenAppControl: ControlWidget { let kind: String = "OpenAppControl" var body: some ControlWidgetConfiguration { StaticControlConfiguration(kind: kind, content: { ControlWidgetButton(action: OpenAppIntent()) { Label("Open The App", systemImage: "clock.fill") } } }) .displayName("Open The App") // This appears in the shortcuts view } } Sample Image These apps use their own image. How can I use my own image?
0
0
92
Dec ’25
Нow to set default values for string array intent field provided dynamically?
Hello everybody! Does anybody know how to set default values for string array intent field provided dynamically? I want to have preset array field values just after widget added I have a simple accessory widget with circular and rectangular representation (the first one is for 1 currency value and the second one is for 3 values). I created CurrencyWidgets.intentdefinition and added AccessoryCurrency custom intent. Here I added string parameter field currencyCode. For this parameter I set the following options: Supports Multiple Values Fixed Size (AccessoryCircular = 1, AccessoryRectangular = 3) User can edit value in Shortcuts Options are provided dynamically Then I created CurrencyTypeIntent extension and added IntentHandler for my custom intent AccessoryCurrency. The code is below class IntentHandler: INExtension, AccessoryCurrencyIntentHandling { override func handler(for intent: INIntent) -> Any { self }     func provideCurrencyCodeOptionsCollection(for intent: AccessoryCurrencyIntent) async throws -> INObjectCollection<NSString> {         return INObjectCollection(items: [NSString("USD"), NSString("EUR"), NSString("RUB"), NSString("CNY")])    } func defaultCurrencyCode(for intent: AccessoryCurrencyIntent) -> [String]? {      return ["USD", "EUR", "RUB"]    } } The problem is in func defaultCurrencyCode(...): when I return something except nil (for example ["USD"] or ["USD", "EUR", "RUB"]) then I got a broken widget. It hangs in a placeholder state in lock screen and at add widget UI (see the image below). Otherwise when I return nil then my widget works fine. But when I try to customise widget then I don't have default values for my currencyCode field, only Chose placeholders. At the same time everything works fine for the single string parameter (without "Supports Multiple Values"). Does anybody know how to make default parameters work for array (multiple) field?
0
0
129
3w
TUINSRemoteViewController over-release crash in ViewBridge during autorelease pool drain
Summary A crash occurs in ViewBridge framework when a TUINSRemoteViewController object receives -release message after being deallocated. This appears to be a reference counting issue within the ViewBridge framework's internal autorelease pool management. Environment macOS Version: [15.0.0] Application: Custom Qt-based application using Chromium Embedded Framework (xcode version: xcode 15; QT version: 6.5.4 ; CEF version: 138.0.47+g2728d53+chromium-138.0.7204.221) Steps to Reproduce Users are typically using the app normally, but a crash occasionally occurs when they activate and click on the application. This happens infrequently, but it occurs roughly every day. Currently, only a few specific users experience this crash, and it may appear for several consecutive days before disappearing for several days. We cannot reliably reproduce this issue but have collected crash logs from affected users. Crash Analysis Zombie Detection Log: Zombie <TUINSRemoteViewController: 0x338708020> received -release Deallocation Stack Trace (when object was first released): 0 Chromium Embedded Framework 0x000000014283a7f4 rust_png$cxxbridge1$ResultOfWriter$operator$sizeof + 933592 1 AppKit 0x000000019eac0d80 -[NSResponder dealloc] + 340 2 AppKit 0x000000019ebb5e34 -[NSViewController dealloc] + 276 3 ViewBridge 0x00000001a3f6ab9c -[NSRemoteViewController dealloc] + 92 4 AppKit 0x000000019eada4b4 -[NSViewController release] + 236 5 ViewBridge 0x00000001a3eda130 -[NSRemoteViewController release] + 380 6 libobjc.A.dylib 0x000000019aa8806c objc_autoreleasePoolPop + 56 7 CoreFoundation 0x000000019aefc7c0 _CFAutoreleasePoolPop + 32 8 Foundation 0x000000019c0d14f4 -[NSAutoreleasePool drain] + 136 9 ViewBridge 0x00000001a3ed609c __CONSIDER_WHO_REQUESTED_THIS_WAIT_BEFORE_SENDING_BUG_TO_VIEWBRIDGE__ + 24 10 ViewBridge 0x00000001a3f82a10 deferredBlockOpportunity_block_invoke_2 + 436 11 CoreFoundation 0x000000019af3dfa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 12 CoreFoundation 0x000000019af3deb0 __CFRunLoopDoBlocks + 356 13 CoreFoundation 0x000000019af3d330 __CFRunLoopRun + 2432 14 CoreFoundation 0x000000019af3c334 CFRunLoopRunSpecific + 572 15 HIToolbox 0x00000001a63740cc RunCurrentEventLoopInMode + 292 16 HIToolbox 0x00000001a6379ebc ReceiveNextEventCommon + 636 17 HIToolbox 0x00000001a637a020 _BlockUntilNextEventMatchingListInModeWithFilter + 76 18 AppKit 0x000000019ea7fa70 _DPSNextEvent + 660 19 AppKit 0x000000019f3a57b8 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 Crash Stack Trace (second release attempt): 0 Chromium Embedded Framework 0x14a03a37c rust_png$cxxbridge1$ResultOfWriter$operator$sizeof + 932448 1 Chromium Embedded Framework 0x14a03a04c rust_png$cxxbridge1$ResultOfWriter$operator$sizeof + 931632 2 CoreFoundation 0x19af1cbe8 ___forwarding___ + 200 3 CoreFoundation 0x19af1ca60 _CF_forwarding_prep_0 + 96 4 libobjc.A.dylib 0x19aa8bd94 AutoreleasePoolPage::releaseUntil(objc_object**) + 204 5 libobjc.A.dylib 0x19aa88138 objc_autoreleasePoolPop + 260 6 CoreFoundation 0x19aefc7c0 _CFAutoreleasePoolPop + 32 7 Foundation 0x19c0d14f4 -[NSAutoreleasePool drain] + 136 8 ViewBridge 0x1a3ed609c __CONSIDER_WHO_REQUESTED_THIS_WAIT_BEFORE_SENDING_BUG_TO_VIEWBRIDGE__ + 24 9 ViewBridge 0x1a3f82a10 deferredBlockOpportunity_block_invoke_2 + 436 10 CoreFoundation 0x19af3dfa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 11 CoreFoundation 0x19af3deb0 __CFRunLoopDoBlocks + 356 12 CoreFoundation 0x19af3d330 __CFRunLoopRun + 2432 13 CoreFoundation 0x19af3c334 CFRunLoopRunSpecific + 572 14 HIToolbox 0x1a63740cc RunCurrentEventLoopInMode + 292 15 HIToolbox 0x1a6379ebc ReceiveNextEventCommon + 636 16 HIToolbox 0x1a637a020 _BlockUntilNextEventMatchingListInModeWithFilter + 76 17 AppKit 0x19ea7fa70 _DPSNextEvent + 660 18 AppKit 0x19f3a57b8 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 19 AppKit 0x19ea72b7c -[NSApplication run] + 480 20 libqcocoa.dylib 0x1057b7514 QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 2156 21 QtCore 0x109bb55c4 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 532 22 QtCore 0x109babff8 QCoreApplication::exec() + 112 23 HoYowave 0x1009fc740 QWidgetFrameAdapter::RunMessageLoop() + 132 24 HoYowave 0x1008ae908 0x10088c000 + 141576 25 HoYowave 0x1008b7038 0x10088c000 + 176184 26 HoYowave 0x1008a3544 0x10088c000 + 95556 27 HoYowave 0x1008a294c 0x10088c000 + 92492 28 dyld 0x19aad4274 start + 2840 Technical Analysis The crash pattern indicates: A TUINSRemoteViewController was autoreleased multiple times During autorelease pool drain, the first release triggered dealloc Subsequent release attempts accessed the deallocated object (zombie) This is entirely within ViewBridge framework's internal code path The function name __CONSIDER_VIEW_SERVICE_BEFORE_SENDING_BUG_TO_VIEWBRIDGE__ in the stack trace suggests this is a known problematic area. Questions Is this a known issue in ViewBridge framework? Is there any workaround or mitigation we can apply from the application side? Could you provide guidance on what might trigger this condition? I have report this in Feedback Assistant FB21809243
0
0
16
3d
Live Activities widget extension does not reflect updated SwiftUI UI (custom views/assets appear ignored)
Hello Apple Developer Technical Support, I’m following up on case #102807413324 and submitting this as a code-level support request. We are integrating iOS Live Activities (ActivityKit + WidgetKit extension written in SwiftUI) into an Expo/React Native app. We’re seeing behavior where the Live Activity UI shown on the Lock Screen appears to “stick” to an older layout and ignores updated SwiftUI code and/or bundled assets, even after rebuilding, reinstalling, and removing existing Live Activities before testing again. Environment Device: iPhone 13 iOS: 26.2 macOS: 15.7.3 (24G419) Xcode: 16.4 (16F6) Expo SDK: 52 React Native: 0.76.9 expo-live-activity: ^0.4.2 Build type: Ad-Hoc signed IPA (EAS local build) Summary We have a WidgetKit extension target (LiveActivity.appex, bundle id: stimul8.LiveActivity) using ActivityConfiguration(for: LiveActivityAttributes.self). The extension contains multiple SwiftUI views selected via a “route” (derived from deepLinkUrl / title / subtitle), and uses images/backgrounds from the extension asset catalog (Assets.xcassets). We also support loading images from an App Group container with a fallback to the asset catalog. After shipping updates, the Live Activity UI shown on the Lock Screen continues to resemble an older/default layout (example: a progress-bar-like element remains visible even after removing ProgressView usage from LiveActivityView.swift). Some custom backgrounds/images also fail to display as expected. Routing (examples) /streak -> StreakLiveActivityView /streak-urgent -> StreakUrgentLiveActivityView /lesson/create -> AILessonLiveActivityView1 /lesson/reminder -> AILessonLiveActivityView2 default -> LiveActivityView Steps to reproduce (high-level) Install/build and trigger a Live Activity. Modify the SwiftUI layout in the extension (e.g., remove ProgressView and change obvious UI elements), rebuild, and reinstall. Remove any existing Live Activities from the Lock Screen, then trigger a new Live Activity again. Observed: Lock Screen Live Activity still renders the prior/older-looking UI and/or ignores updated assets. Troubleshooting already done Verified the extension (LiveActivity.appex) is included in the IPA and properly signed. Verified Assets.car is present in the extension and PNG assets are present in the build artifacts. Ensured SwiftUI source files used by the extension are overwritten during prebuild so the intended versions are present in ios/LiveActivity. Cleared DerivedData related to LiveActivity builds. Reinstalled the app and removed existing Live Activities from the Lock Screen before re-triggering new ones. Questions Is there any known caching behavior where Live Activities can continue to display a previous UI layout after an app/extension update, even when the activity is re-created? Are there recommended steps to force the system to load the newest widget extension binary/UI beyond reinstalling and removing existing Live Activities? What’s the recommended way to confirm which exact extension binary/UI version is being rendered on-device (e.g., specific Console logs, sysdiagnose signals, or other indicators)? Are there any known constraints with Assets.xcassets usage for Live Activities that could cause bundled assets not to render even when present? We can provide A minimal reproduction Xcode project (preferred) The IPA build Build logs (Xcode/EAS) Screenshots/video and a sysdiagnose captured after reproduction Thank you for your guidance. Best regards
0
0
9
3h
App widget not appearing in widget list (intermittent)
There seems to be a long running issue with WidgetKit where some users don't see the widget when trying to add to their Home Screen. (even after opening the app for the first time). I have been able to reproduce myself intermittently, and typically restarting the phone or re-installing the app fixes the problem. However, some of my users have encountered this and end up requesting refunds because they think the app is broken. Has anybody else experienced this issue? Would be great to get this bug resolved as it's frustrating for users.
1
2
625
Sep ’25
iOS Team Provisioning Profile does not include Activity Kit
I would like to add a Live Activity to my app, but unfortunately I always get an error message. When I go into the Identifiers via the Developer Portal and look at my app, there is no Activity Kit or Live Activity in the Capabilites that I could activate. In XCode I don't see the option for Signing & Capabilities either... Can anyone help me how to add this correctly? Thanks in advance!
1
1
190
Apr ’25