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
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
Hi there,
I'm using WCSession to communicate watchOS companion with its iOS app.
Every time watch app becomes "active", it needs to fetch data from iOS app, which works e.g. turning my hand back and forth.
But only when the app is opened after it was minimised by pressing digital crown, it didn't fetch data. My assumption is that scenePhase doesn't emit a change on reopen.
Here is the ContentView of watch app:
import SwiftUI
struct ContentView: View {
@EnvironmentObject private var iOSAppConnector: IOSAppConnector
@Environment(\.scenePhase) private var scenePhase
@State private var showOpenCategories = true
var body: some View {
NavigationStack {
VStack {
if iOSAppConnector.items.isEmpty {
WelcomeView()
} else {
ScrollView {
VStack(spacing: 10) {
ForEach(iOSAppConnector.items, id: \.self.name) { item in
ItemView(item: item)
}
}
}
.task {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
loadItems()
}
}
.onChange(of: scenePhase, initial: true) { newPhase, _ in
if newPhase == .active {
loadItems()
}
}
}
fileprivate func loadItems() -> Void {
if iOSAppConnector.items.isEmpty {
iOSAppConnector.loadItems()
}
}
}
What could be the issue?
Thanks.
Best regards
Sanjeev
Hi 🙋
Has anybody gotten subtitles in macOS Tahoe Control Widgets to show up in their custom control widgets? Seems macOS is able to do it (see attached screenshot of the Bluetooth control widget), but my widget, which shows a title and subtitle on iOS, will only show the title on macOS.
I tried all the different ControlWidgetButton init methods to no avail. I tried a VStack for my title and subtitle Texts, I tried just two Texts without a VStack, I tried the controlWidgetStatus and controlWidgetActionHint modifiers out of desperation... nothing worked.
Any pointers much appreciated!
Thank you,
– Matthias
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?
I was very excited to see the addition of push notifications for widgets. However upon further inspection, the way it is implemented seems too limiting for real life apps.
I have an app for time tracking with my own backend. The app syncs with my backend in the main executable (main target). My widgets are more lightweight as they only access data in the shared app container, but they don't perform sync with the server directly to avoid race conditions with the main app.
I was under the impression that the general direction of the platform is to be doing most things in the main app target (also App Intents work that way for the most part), so the fact that the WidgetPushHandler just calls the widget's method to reload the timeline is very unfortunate. In an ideal scenario I also need the main app to be 'woken up' to perform the sync with the server, and once that's done I'd update the widget's timeline and where I would just read data from the shared app container.
So, my questions are:
What is the recommended way of updating the widgets when this push notification arrives in the case that the main app target needs to perform the sync first?
Is there any way how to detect that the method
func timeline(for configuration: InteractiveTrackingWidgetConfigurationAppIntent, in context: Context)
was called as a result of the push notification being received?
Can I somehow schedule a background task from the widget's reloadTimeline() function?
How can I get the push token later, in case that I don't save it right away the first time the WidgetPushHandler's pushTokenDidChange() is called?
Thank you for your work on this and hopefully for your answers.
FB19356256
Hi everyone, I'm using an app group to share data between iOS and it's watch companion app.
I ensured that is has the same identifier in Signing & Capabilities and in the .entitlements files.
Here is the UserDefaults part:
class UserDefaultsManager {
private let suitName = "group.com.sanjeevbalakrishnan.Test"
public func saveItems(_ items: [ItemDTO]) {
print("Save \(items.count) items to shared defaults")
let defaults = UserDefaults(suiteName: suitName)
let data = try? JSONEncoder().encode(items)
defaults?.set(data, forKey: "items")
}
public func loadItems() -> [ItemDTO] {
let defaults = UserDefaults(suiteName: suitName)
print(defaults)
guard let data = defaults?.data(forKey: "items") else {
print("watchOS received data is empty")
return []
}
let items = [ItemDTO].from(data: data)
print("Load \(items.count) items from user defaults")
return items
}
}
For testing I called loadItems after saveItems on iOS app and it returned items. However, on watchOS app it always returns empty array.
What do I need to consider?
Thanks.
Best regards
Sanjeev
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.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
User Notifications
ActivityKit
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!
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
LiveActivity using colorScheme to adapt to dark mode in iOS 26 system does not work
The system keeps returning. mark, unable to switch
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
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
https://communities.apple.com/fr/thread/256121053
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
The docs are conflicting.
https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications#End-the-Live-Activity-with-a-custom-dismissal-date says:
When you end a Live Activity, by default the Live Activity appears on the Lock Screen for up to four hours after it ends to allow people to glance at their phone to refer to the latest information.
However here it says:
https://developer.apple.com/documentation/activitykit/displaying-live-data-with-live-activities#Understand-constraints
A Live Activity can be active for up to eight hours unless its app or a person ends it before this limit. After the eight-hour limit, the system automatically ends the Live Activity, and immediately removes it from the Dynamic Island. However, the Live Activity remains on the Lock Screen until a person removes it or for up to four additional hours before the system removes it — whichever comes first. As a result, a Live Activity remains on the Lock Screen for a maximum of 12 hours.
So is it 4 hrs OR '8 for Dynamic Island vs 12 for Lock Screen'?
When does alarmkit's alarm displayed in Live activity?
I think it is very random.
is there any condition for this?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
I currently test AlarmKit's API with my project.
But I find that AlarmKit API presents its UI inconsistently.
When i turn off my device and re-install my application, it presents its alarm in Live activity, but sometimes doesn't.
Is there any rules to present Alarm UI?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
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?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
APNS
User Notifications
ActivityKit
Hi everyone,
I’m working on implementing Live Activities in my app, and I’ve encountered an issue where the Live Activity updates work intermittently when the app is in the background. Sometimes they update correctly, but at other times, they don’t update at all, even though they should be running in the background.
However, when the app is brought to the foreground, the updates happen correctly.
A few things I’ve checked:
The app is using ActivityKit to update the Live Activity with Activity.update().
I’ve enabled the necessary background modes in the Capabilities section.
Is there a possibility that I’m hitting the system budget limit while experiencing this issue? If this is a limitation, how can I avoid it or manage this situation?
Has anyone else faced this issue? Any advice or potential solutions would be greatly appreciated!
Thank you!
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Swift
SwiftUI
WidgetKit
ActivityKit
I am currently developing an interactive widget, but an AppIntent issue blocked me for 2 days.
I have an AppIntent named TimerActionIntent, which has two parameters: TimerType and TimerAction. Here is the code:
import AppIntents
enum TimerType: Int, CaseIterable, AppEnum, AppEntity {
case sleep
case feeding
static let typeDisplayRepresentation: TypeDisplayRepresentation = "Timer Type"
static let caseDisplayRepresentations: [TimerType : DisplayRepresentation] = [
.sleep: "Sleep",
.feeding: "Feeding"
]
}
enum TimerAction: Int, CaseIterable, AppEnum, AppEntity {
case start
case pause
case stop
static let typeDisplayRepresentation: TypeDisplayRepresentation = "Timer Action"
static let caseDisplayRepresentations: [TimerAction : DisplayRepresentation] = [
.start: "Start",
.pause: "Pause",
.stop: "Stop"
]
}
struct TimerActionIntent: AppIntent {
static let title: LocalizedStringResource = "Operate a Log Timer"
@Parameter(title: "Timer", default: .sleep)
var timerType: TimerType
@Parameter(title: "Action", default: .start)
var action: TimerAction
static var isDiscoverable: Bool = false
static var openAppWhenRun: Bool = false
init() {}
init(timerType: TimerType, action: TimerAction) {
self.timerType = timerType
self.action = action
}
func perform() async throws -> some IntentResult {
// perform the action
Self.openAppWhenRun = state == .stopped
}
return .result()
}
}
I can't execute the AppIntent if using the following code:
Button(intent: TimerActionIntent(timerType: .sleep, action: .start)) {
// button view
}
// or
let intent = TimerActionIntent()
intent.timerType = timerType
intent.action = .start
Button(intent: intent) {
// button view
}
and only execute when initialize TimerActionIntent without any parameters and @Parameter has the default value. e.g.
Button(intent: TimerActionIntent()) {
// button view
}
I have some logs in the Console app:
default 17:51:27.626382+0800 linkd Accepting XPC connection from PID 39255 for service "com.apple.linkd.registry"
default 17:51:27.637511+0800 WidgetsExtension Beginning PerformAction <<SB:788D850BBBC5>>
default 17:51:27.637540+0800 WidgetsExtension Beginning InitializeAction <<SB:ACBC7A27CCBF>>
default 17:51:27.637556+0800 WidgetsExtension [InitializeAction <<N:ACBC7A27CCBF>>] Found TimerActionIntent matching TimerActionIntent registered with AppManager
default 17:51:27.637725+0800 WidgetsExtension Prepared timerType to TimerType(TimerType/0))
default 17:51:27.637744+0800 WidgetsExtension Prepared action to TimerAction(TimerAction/0))
default 17:51:27.637772+0800 WidgetsExtension Ending InitializeAction <<SE:ACBC7A27CCBF>>
default 17:51:27.637795+0800 WidgetsExtension Beginning ResolveParameters <<SB:6C7CA02308AD>>
default 17:51:27.639807+0800 WidgetsExtension Building resolver for parameter timerType<TimerType> = TimerType/0
default 17:51:27.640160+0800 WidgetsExtension Building resolver: EntityIdentifier → TimerType:TimerActionIntent:timerType
default 17:51:27.640202+0800 WidgetsExtension Ending ResolveParameters <<SE:6C7CA02308AD>>
default 17:51:27.640221+0800 WidgetsExtension Beginning NeedsDisambiguation <<SB:8E482F9CCCB0>>
default 17:51:27.641328+0800 WidgetsExtension Ending NeedsDisambiguation <<SE:8E482F9CCCB0>>
default 17:51:27.641344+0800 WidgetsExtension Ending PerformAction <<SE:788D850BBBC5>>
error 17:51:27.642316+0800 chronod Perform action connection operation completed with error: Error Domain=LNActionExecutorErrorDomain Code=2010 "(null)"
error 17:51:27.642774+0800 chronod Operation `<LNPerformActionConnectionOperation: 0x600002c4a180, identifier: F8FB77C5-7F8A-4670-BB8C-465DE4EAB6B8>` error Error Domain=LNActionExecutorErrorDomain Code=2010 "(null)"
default 17:51:27.643358+0800 linkd Invalidated XPC connection from PID 39255 for service "com.apple.linkd.registry"
I can't find any details about the error " Error Domain=LNActionExecutorErrorDomain Code=2010 "(null)""
The environment:
Xcode: 16.4/26 beta 5
iOS: iOS Simulator 18.5, iOS Simulator 26, iPhone 16 Pro Max 18.6
macOS 15.6
Can anyone help me, please!
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
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?
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.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
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