I've noticed that the when starting live activities via a remote push-to-start notification, the live activity widget consistently succeeds in displaying on the lock screen. However push-to-update token is not always received by the task observing the pushTokenUpdates async-sequence.
Task {
print("listening for pushTokenUpdates")
for await pushToken in activity.pushTokenUpdates {
let token = pushToken.map {String(format: "%02x", $0)}.joined()
print("Push token: \(token)")
}
}
The log will print "listening for pushTokenUpdates" however occasionally the "Push token: ___" line will not be present even when the widget has displayed on screen. This happens even if the "allow" button has been selected on live activities for that app. The inconsistent behavior leads me to believe there is an issue at the ActivityKit level. Would appreciate any feedback in debugging this!
Widgets & Live Activities
RSS for tagDiscuss how to manage and implement Widgets & Live Activities.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I tested it on the app I work with and others I use and the notification message is not appearing when using sleep mode
Iphone: 13 mini
IOS: 18.4.1
I have implemented a Live Activity that includes two buttons. Currently, both buttons utilize deep links to open the main application, where I then detect the URL to perform the corresponding action.
My primary question is:
Is it possible to update a button's title and/or color within a Live Activity without requiring the main application to open?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Does live activity require notification permission? If you need to update card data through APNS, I remember that it was required in the past, otherwise the card could not be created. This year I tried it and some apps did not have notification permission, but they could also use live activity and update data
We are developing a service that uses the “More Frequent Updates” feature of Live Activities.
I have a question regarding the push notification budget for Live Activities.
According to the documentation and the following session:
WWDC23 Session 10185 – “What’s New in ActivityKit”
https://developer.apple.com/videos/play/wwdc2023/10185/
At 11:58, it is stated that there is no limit on the number of updates when using low priority (5).
Could you confirm whether updates sent with low priority (5) are indeed not subject to the Live Activity push notification budget?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Hello,
I'm trying to create a widget using the WidgetKit framework. In this part, I'm using Intents along with a DynamicOptionsProvider. As shown in the Medium article below, I want to present multiple options when "Edit Widget" is tapped:
https://levelup.gitconnected.com/swiftui-configurable-widget-to-let-our-user-choose-4a54e398f42f
However, in this example, the options are provided statically. What I want to achieve is to display a list of devices based on the selected HomeId after the user selects a Home. I’ve set up the interface accordingly, but when I select a Home, the device list does not update.
How can I make this work? The two options should be dependent on each other.
body: error when I run the app,and the frame just became freezed.
WatchOS26 ControlWidget cannot display image copy or click
import Foundation
import SwiftUI
import WidgetKit
import AppIntents
internal import Combine
struct WidgetToggle: ControlWidget {
var body: some ControlWidgetConfiguration {
StaticControlConfiguration(kind: "com.example.myApp.performActionButton", provider: TimerValueProvider()) { isRunning in
ControlWidgetToggle("WidgetToggle", isOn: isRunning, action: ToggleTimerIntent()) { isOn in
Label(isOn ? "Running" : "Stopped", systemImage: isOn ? "hourglass.bottomhalf.filled" : "hourglass")
}
}
.displayName("WidgetToggle")
.description("WidgetToggle description")
}
}
struct TimerValueProvider: ControlValueProvider {
var previewValue: Bool {
return false
}
func currentValue() async throws -> Bool {
return TimerManager.shared.isRunning
}
}
struct ToggleTimerIntent: SetValueIntent {
static var title: LocalizedStringResource = "WidgetToggle"
@Parameter(title: "Toggle")
var value: Bool
func perform() async throws -> some IntentResult {
TimerManager.shared.isRunning = value
return .result()
}
}
class TimerManager: ObservableObject {
static let shared = TimerManager()
@Published var isRunning = false
}
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
I am developing Live Activities using Swift. The same code can display the lock screen view and Dynamic Island on most devices, but on one specific iPhone 16 Pro Max, the Dynamic Island is not shown. The system version is iOS 18.0. However, other apps on this phone can display the Dynamic Island normally. How should I troubleshoot the issue? Can anyone help me? Thank you.
我们在使用clip轻应用功能,在App Store Connect中配置了高级轻应用体验,并配置了相关的https链接(在构建版本页面此域名是已验证状态),但是我们在使用此链接进行NFC触碰时,不会拉起来clip轻应用,只会显示“XXXX NFC标签”,使用Apple的官方链接:https://appclip.apple.com/id?p=xxxx,是可以拉起来轻应用的,请问各位大佬,我们的问题出现在哪?该如何解决?
https://developer.apple.com/watchos/whats-new/
Is there an example demo available
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
When updating from beta 1 to beta 2, CarPlay now only shows 1 column instead of the two or three that were in beta 1.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
I'm currently working on enhancing our app’s support for App Intents. We're aiming to suggest time-sensitive shortcuts to Spotlight and Siri — for example, proactively surfacing certain shortcut from 2 hours before some event the user has registered in their database until 2 hour after that.
I’ve been reviewing the AppIntents framework documentation but haven’t found a definitive answer on whether this is currently achievable.
From what we understand, the RelevantIntent and RelevantContext APIs appear to support time-based suggestions, but they seem to apply only to Widgets, not to standalone app shortcuts. Is this understanding correct, and is there a recommended approach for achieving time-sensitive shortcut suggestions outside of a Widget context?
Any guidance would be greatly appreciated.
Best regards,
Hi Everyone. I wanna run the live activity in terminated state. I have implemented the push notification flow which is working fine in foreground and background state. In the terminated state, the push to start token is not getting generated. How to make it work?
Hi everyone and Apple support,
I’ve built an app that continuously runs and receives temperature data from a sensor. When a threshold is reached, I use Live Activities with the push notification flow to display alerts on the Dynamic Island. The Live Activity and push notification flow work fine in foreground and background states. However, I’m trying to support push-triggered Live Activities when the app is in the terminated state. Since my app rarely terminates, I can’t confirm if the Live Activity push token is generated in that state. It seems like it isn’t, which blocks the Live Activity from starting via push. I tried with both pushtostarttoken and pushtostarttokenupdates. None of them worked.
Has anyone dealt with this or found a workaround to ensure the push token is available even when the app is terminated?
We have a Subscription based feature in our App, using which a user can say something like "Ask Mickey". However we want to enable this system Shortcut only when the user has subscribed to certain premium features.
i.e. If the User is not subscribed to Premium Services, we do not want to show this Shortcut.
However, when adding any conditional code inside AppShortcutsProvider, I am getting the following Compile Time errors:
**'AppShortcutsProvider' property 'appShortcuts' requires builder syntax
AppShortcut builders support only a platform availability if statements, not general if statements'**
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
I am trying to feature flag widgets in my Widget extension. This feature flag value is stored remotely, read by my main app, and written to UserDefaults, then read from UserDefaults in my widget target. I understand that providing an empty array of WidgetFamilys will not show my app when the user goes to add a widget.
However, even when this flag flips to true, hard-closing and reopening my app will not show my app in the list of apps you can add a widget for. But I notice that if I recompile my app from Xcode (running the app's scheme, not the widget scheme), then my app will show when you search for an app to add a widget for, making me think that these Widget objects are only created by the system once when the app is initially installed/updated.
My concern is that I will not be able to flip this flag from false to true after the user has installed my app to do a rollout of my widget. Is this expected? Or is there an alternative or otherwise recommended way of doing this?
struct MyWidget: Widget {
let kind = "MyWidget"
var supportedFamilies: [WidgetFamily] {
let manager = ExtensionManager()
if manager.widgetsEnabled {
return [.systemSmall, .systemMedium, .systemLarge]
}
else {
return []
}
}
var body: some WidgetConfiguration {
IntentConfiguration(
kind: kind,
intent: MyWidgetIntent.self,
provider: MyWidgetProvider()
) { entry in
MyWidgetView(entry: entry)
}
.configurationDisplayName("My Widget")
.description("Install my widget!")
.supportedFamilies(supportedFamilies)
}
}
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!
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.
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