I configured my app to show a Live Activity when an alarm rings using AlarmKit. However, if I dismiss the Live Activity by tapping somewhere other than the X button, and then long-press the Dynamic Island, a new Live Activity appears that is long but contains no information.
Currently, the only way I can remove this empty Live Activity is to press the X button while the alarm is in the snooze state. Pressing the X button on the initial alarm does not remove it.
Is there any way to prevent this behavior or properly handle / clean up this empty Live Activity?
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
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?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
WidgetKit
Intents
App Intents
Subject: Request to maintain the "Status Bar Breadcrumb" visibility while Dynamic Island is active
Hi,
I am developing an app using ActivityKit and Dynamic Island. I've noticed a significant UX regression regarding the system status bar behavior.
Current Behavior: When a Live Activity is active in the Dynamic Island (specifically in the compactLeading and compactTrailing presentation), the system automatically hides the "Back to [Previous App]" breadcrumb button (the small arrow and app name) in the top-left corner of the status bar.
This breadcrumb only reappears when the Live Activity switches to the minimal presentation or is dismissed.
The Issue: This behavior makes multitasking cumbersome for users. For example, if a user navigates from Safari to my app and then locks the screen or goes to Home, they expect the "Back to Safari" button to remain accessible. However, because my app's Live Activity is running in the Dynamic Island, the OS removes this navigation shortcut, forcing users to use the app switcher instead.
Why this should be changed:
Screen Real Estate: On larger devices (e.g., iPhone 15/16 Pro Max), there is significant whitespace in the top-left corner between the time and the Dynamic Island's leading edge. The breadcrumb could easily fit there without overlapping the Live Activity content.
Inconsistent UX: Users are confused why the navigation button disappears solely because a background activity is running.
Request: Please consider updating the status bar layout logic to allow the "Back to App" breadcrumb to remain visible if there is no physical overlap with the compactLeading view of the Dynamic Island.
Thank you.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Hey!
I'm working on enabling remotely started live activities. I'm running into 2 crashes:
Upon initializing ActivityAuthorizationInfo
Upon calling Activity<...>.activities array
Both stack traces look like this:
0 libsystem_kernel.dylib +0xce0 _mach_msg2_trap
1 libsystem_kernel.dylib +0x4398 _mach_msg2_internal
2 libsystem_kernel.dylib +0x42b4 _mach_msg_overwrite
3 libsystem_kernel.dylib +0x40fc _mach_msg
4 libdispatch.dylib +0x1cc04 __dispatch_mach_send_and_wait_for_reply
5 libdispatch.dylib +0x1cfa4 _dispatch_mach_send_with_result_and_wait_for_reply
6 libxpc.dylib +0x107ec _xpc_connection_send_message_with_reply_sync
7 BoardServices +0xaea8 -[BSXPCServiceConnectionMessage _sendWithMode:]
8 BoardServices +0x17938 -[BSXPCServiceConnectionMessage sendSynchronouslyWithError:]
9 BoardServices +0xeef0 ___71+[BSXPCServiceConnectionProxy createImplementationOfProtocol:forClass:]_block_invoke
They happen to a limited number of users, but not insignificant. Most are on iOS 18.6.2 and iOS 26.1, but there are others in the mix. I don't have a repro myself. It looks like the main thread gets blocked after we receive no response from these ActivityKit APIs. Both of these are called inside application:didFinishLaunchingWithOptions:.
For ActivityAuthorizationInfo, we need the app to communicate with the server whether the user has live activities enabled; hence, calling this object's init as early as possible in the app.
For activities array, I'd like to do some logging whenever the live activity is started or ended (for example, if activities array no longer contains any activities, we can log the activity as dismissed). For this logging to happen, as far as I understand, it has to happen inside didFinishLaunchingWithOptions since this is the only method being called upon the terminated app receiving background runtime when the live activity starts/ends remotely.
After some research, one potential reason is ActivityKit APIs are just not ready to return values via xpc connection at app startup, so moving these methods to applicationDidBecomeActive could resolve the problem. That's fine for ActivityAuthorizationInfo init, but for accessing activities, there is no other place in the lifecycle to see if an activity has been dismissed (especially in the scenario where app is terminated, so we get only 30 seconds ish of background runtime).
Curious if anyone has run into this or has any insights into ActivityKit API behavior.
Since watchOS 26, watch face sharing has stopped working completely.
I tested the following:
Sharing via CLKWatchFaceLibrary
Other public APIs
Sharing via iMessage
In all cases, the watch face cannot be reinstalled after being shared.
This issue is not limited to my app. Large third-party apps such as Facer and other major watch face platforms are also affected, which suggests this is a system-level change or bug.
Everything worked correctly before watchOS 26.
Has Apple officially acknowledged this issue?
Is there a recommended place to report or track this bug?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Face Sharing
watchOS
Watch Complications
WidgetKit
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?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
SwiftUI
WidgetKit
App Intents
I've been implemented App Shortcuts into my apps which are localized for a variety of languages.
The WWDC23 "Spotlight your app with App Shortcuts" has been extremely helpful in resolving my localized trigger phrases issue, but before I continue filling out all of the trigger phrases for my application I am concerned about a limitation that was mention in the video and need some additional information about it.
The limitations noted in the video at minute mark 21:26 states that:
Maximum 10 App Shortcuts (OK)
Maximum 1000 trigger phrases...
If I have 1 app and 10 shortcuts, and each shortcut only uses (.applicationName), this means I get to have 100 trigger phrases for each shortcut (for the sake of the discussion).
What I'm unsure about is when I begin providing localization do the localized triggered phrases count toward the trigger phrase limit? Essentially, for every language I support do I have to drop 1/2 of all of my trigger phrases to stay under the limit?
At the moment, my app is supporting 40 languages and I would like to know how localization affects the trigger phrase limit.
Thank you!
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Shortcuts
Intents
App Intents
(I truly appreciate all the responses you all have written for me :bow: )
I was under the assumption that for Live Activity, in order for you to be able to update the Activity, you need an update token. And for the OS to issue you the update token, user must hit the "Allow" from the lock screen.
However based on these screenshots it seems that you don't need to hit "Allow" to be able to update the Live Activity.
Live Activity was updated — even without the user hitting "Allow"
So now I'm wondering if:
Is hitting Allow required for the update token to get issued? Or that assumption is incorrect? In our tests (when connected to Proxyman, the OS emits the update token after user hits "Allow" / "Always Allow")
If you don't hit allow, are there alternate ways to update the Live Activity without having the update token?
I'm guessing you could set a short stale time and then when the OS launches the app in the background you query the server and then update the Live Activity. Is that a worthy approach?
I also noticed that the "The Philly Inquirer" App has 'Background App Refresh" enabled, but this happened in 2 minutes. In our architecture assessments, after reviewing Apple's docs on 'Background Processing", we didn't think of it as a viable option, because it can't guarantee if the OS is given time in the next 2 minutes or 10 hours later when the phone is getting charged again.
Are any of these workarounds viable or are there alternate approaches?
Our requirement is:
be able to use Live Activity between 2-72hrs after app install. (I mention this because perhaps Apple may impost some restrictions for new installs)
be able to update an active Live Activity within 1-2 minutes after it has began.
I want to make a app that indicates that the app is recording in the background using a indicator on the dynamic island or on the top of the phone screen but i can't figure it out on Xcode. Saw a guy do it by making live activities true but can't seem to find that option in background mode in capabilities. any ideas?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
We are using the MPNowPlayingInfoCenter API to provide information to the “Now Playing” system UI. This works as expected, except that when the app is manually terminated, the information is removed from the UI.
Our question is: Some apps (for example, Audible) are able to appear in the “Recently Played” section of the UI. This section seems to show a history of apps that previously provided “Now Playing” information but are not currently playing anything.
We would like to know which API is used to achieve this behavior.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Hi,
We design a Live Activity for our app.We find that in iOS26 system, the widget can not display the correct system display model(Light mode or dark mode), always display with dark mode. When our app run in other system ,such as iOS 17, iOS18 ,it work fine.
I find other developer had post a topic three month ago , but it seems there is not any new response about the feedback.
https://developer.apple.com/forums/thread/799684?answerId=857377022#857377022
Anyone have idea?
Thanks .
Below is my code template:
struct BroadcastLiveActivityBackgroundView: View {
@Environment(\.colorScheme) var colorScheme: ColorScheme
var body:some View {
LinearGradient(
stops: [
Gradient.Stop(color: LiveActivityColor.backgroundColors(self.colorScheme).last!, location: 0.00),
Gradient.Stop(color: LiveActivityColor.backgroundColors(self.colorScheme).first!, location: 1.00),
],
startPoint: UnitPoint(x: 1, y: 0),
endPoint: UnitPoint(x: 0.82, y: 1.11)
)
}
}
I paid for the program a few days ago , how long till I’m approved?
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
Hello, I have tried a lot to get AlarmKit to work from a controlwidget without first going into the app. So far, I have not been successful unless I also opened the app on clicking the controlwidget. Is this a known limitation?
I am looking into the new CarPlay support for systemSmall widgets introduced in iOS 26 (Apple documentation).
I am trying to figure out if there is a way to programmatically detect whether the widget is currently being displayed on the iPhone/iPad home/lock screen or in CarPlay.
So far, I haven’t found any information in the documentation or APIs that indicate how to distinguish between these environments. Is there an API, environment value, or best practice for handling this scenario?
Thanks in advance for any insights!
Good morning,
We are implementing Live Activities in a push-to-start flow. We wrap the listener for push to start tokens in a high priority task:
if ptsListenerTask == nil || ptsListenerTask?.isCancelled == true {
ptsListenerTask = Task(priority: .high) { [weak self] in
for await pushToken in Activity<LiveAuctionAttributes>.pushToStartTokenUpdates {
//Send token to back-end
}
}
I've tried a few variations of this and they work well on most devices. I have seen a couple of devices that refuse to issue a push to start token.
The user will have logging for the init flow and starting the PTS listener then the logs just go silent, nothing happens.
One thing that seemed to work was getting the user to start a Live Activity manually (from our debugging tool) then the PTS token gets issued.
This is not very reliable and working a mock live activity into the flow for obtaining a PTS token is a poor solution.
Is anyone else seeing this and is there a known issue with obtaining PTS tokens?
Thanks!
Brad
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?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Internationalization
Localization
Hello,
in my widget the user displays images filling the whole widget with overlayed texts (via ZStack). Via shadows or text background color the text gets better readable.
However, when a user chooses transparent or tinted colors for the home screen, the text is barely or not readable anymore since e.g. white text on white image background. How to resolve this issue?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
SwiftUI
Visual Design
WidgetKit
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?
Hey,
I successfully set my app to use alarm kit, alarm is showing up and everything, but I noticed that the sound I created (mp3 files, less than 30 sec each) only plays once, does not repeat itself. Is that intended?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities