I'm updating some of the views for a Live Activity, now that CarPlay can display Live Activities in iOS 26. My Activity is updated only with local updates from the iPhone (no push notifications), displaying a user's blood glucose.
The activity updates fine in both CarPlay and in the Apple Watch Smart Stack, but in CarPlay, the previous values are not cleared when the new values are displayed, resulting in superimposed text and making it essentially unreadable. This only happens when the iPhone screen is off. As soon as the phone screen is woken up, even if the phone is not unlocked, the old values disappear and the display looks fine.
I can't find anything in the API about clearing a display, so I'm wondering if this is a bug (especially since it clears when waking the phone screen). I'm running iOS 26.0.1 on my test phone.
Thanks for any thoughts!
WidgetKit
RSS for tagShow relevant, glanceable content from your app on iOS and iPadOS Home Screen and Lock Screen, macOS Desktop, Apple Watch Smart Stack and Complications, and in StandBy mode on iPhone.
Posts under WidgetKit tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Filed as FB20766506
I have a very simple use case for a rectangular widget on the iPhone lock screen: One Text element which should fill as much space as possible. However, it only ever does 2 per default and then eclipses the rest of the string.
Three separate Text elements work fine, so does a fixedSize modifier hack (with that even four lines are possible!). Am I completely misunderstanding something or why is this not possible per default? Other apps' widgets like Health do it as well.
My attempt (background added for emphasis)
Health app widget
var body: some View {
VStack(alignment: .leading) {
/// This should span three lines, but only spans 2 which eclipsed text.
Text("This is a very long text which should span multiple lines.")
// .fixedSize(horizontal: false, vertical: true) /// Using this fixes it as well, but that does not seem like a good default solution.
/// Three separate `Text` elements work fine.
// Text("This is a very long")
// Text("text which should")
// Text("span multiple lines.")
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
.background(Color.black) /// Added for emphasis of the widget frame
}
Summary
When a SwiftUI widget uses a Link containing an Image modified with .widgetAccentedRenderingMode (using any mode except .fullColor), tapping the image on the widget launches the app but does not pass the expected deep link URL to the SceneDelegate.
Steps to Reproduce
Create a SwiftUI Widget View with a Link:
struct ImageView: View {
var image: UIImage
var body: some View {
Link(URL(string: "myapp://image")!) {
Image(uiImage: image)
.resizable()
.widgetAccentedRenderingMode(.accentedDesaturated) // or any mode other than .fullColor
.scaledToFill()
.clipped()
}
}
}
Add Custom URL Scheme in Info.plist:
<dict>
<key>CFBundleURLName</key>
<string>com.company.myapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
</dict>
Implement Deep Link Handling in SceneDelegate:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let url = connectionOptions.urlContexts.first?.url {
handle(url)
}
}
func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) {
if let url = urlContexts.first?.url {
handle(url)
}
}
private func handle(_ url: URL) {
// Process URL here
}
Run the application on a device or simulator.
Add the widget to the Home Screen.
Tap the image inside the widget.
Expected Result
The application launches and receives the URL in SceneDelegate, as expected.
Actual Result
The application launches, but the URL is not passed to SceneDelegate.
Both connectionOptions.urlContexts and openURLContexts are empty.
Using desaturated mode on an image in a widget will break any links or buttons that use the image as their 'label'.
Using the following will just open the app as if there was no link at all - therefore just using the fallback userActivity handler, or any .widgetURL() urls provided.
Link(destination: URL(string: "bug://never-works")!) {
Image("puppy")
.widgetAccentedRenderingMode(.desaturated)
}
The same goes for buttons:
Button(intent: MyDemoIntent()) {
Image("puppy")
.widgetAccentedRenderingMode(.desaturated)
}
I've tried hacky solutions like putting the link behind the image using a ZStack, and disabling hit testing on the image, but they don't work. Anything else to try?
Logged as Feedback #15152620.
To reproduce this bug create a new Xcode Project for IOS choose UIKit. In the app delegate add the following lines.
As you can see in the above image . Line 19 with the initialization of PHPickerViewController has no compilation failure.
Now lets add import WidgetKit
As soon as widgetKit is imported a compiler error is thrown which is PHPickerViewController is not in scope.
This worked with Xcode 16.4
It was possible to have a swift file with both WidgetKit implementations and PhotosUI implementations. This behavior has changed in Xcode 26/26.0.1 .
Does anybody know why this happens , could not find any clues within the different versions of documentations.
P.S
Found a work around which raises further questions
Adding import SwiftUI fixes this problem , I am genuinely curious on how this is happening on a compiler level.
LINKS
To my previously published post :https://developer.apple.com/forums/thread/804059
I have developed a Widget Extension with editable dynamic options.
`struct ModelQuery: EntityStringQuery {
public var allModels:[ModelEntity] {
// from App Groups UserDefaults
let models = SharedDataManager.getModelList()
// 检查原始数据是否为空,避免转换后的数据异常
guard !models.isEmpty else {
return []
}
let entites = models.map{ModelEntity(from: $0)}
return entites
}
func entities(for identifiers: [ModelEntity.ID]) async throws -> [ModelEntity] {
let models = allModels
if models.isEmpty {
return []
}
// 尝试匹配ID
let matchedEntities = identifiers.compactMap { id in
models.first { $0.id == id }
}
// 如果没有匹配到任何实体,返回默认的第一个站点
if matchedEntities.isEmpty && !models.isEmpty {
return [models[0]]
}
return matchedEntities
}
func entities(matching string: String) async throws -> [ModelEntity] {
let stations = allModels
if stations.isEmpty {
return []
}
if string.isEmpty {
return stations
}
let lowercasedString = string.lowercased()
let filteredStations = stations.filter { station in
station.name.lowercased().contains(lowercasedString)
}
if filteredStations.isEmpty {
return []
}
return filteredStations
}
func suggestedEntities() async throws -> [ModelEntity] {
return allModels
}
}`
Below is how it looks when functioning properly
However, when I tested it on iOS 26, occasional "Failed to Load" errors or unknown errors occurred. The same issues did not appear on iOS 17 or iOS 18.
Hi everyone!
My Apple Watch app has relied for years on the WKApplication.scheduleBackgroundRefresh(...) method to keep the app updated in the background. The system would reliably trigger WKApplicationDelegate.handle(_:), where I would then schedule the next refresh task (usually 15 minutes later).
As stated in the documentation, as long as there is a complication on the watch face, these background tasks should run at a relatively stable frequency.
However, this approach seems to have stopped working on watchOS 26. I no longer receive any WKApplicationRefreshBackgroundTask at all. Has anyone else experienced this issue?
My implementation of LockedCameraCapture does not launch my app when tapped from locked screen. But when the same widget is in the Control Center, it launches the app successfully.
Standard Xcode target template:
Lock_Screen_Capture.swift
@main
struct Lock_Screen_Capture: LockedCameraCaptureExtension {
var body: some LockedCameraCaptureExtensionScene {
LockedCameraCaptureUIScene { session in
Lock_Screen_CaptureViewFinder(session: session)
}
}
}
Lock_Screen_CaptureViewFinder.swift:
import SwiftUI
import UIKit
import UniformTypeIdentifiers
import LockedCameraCapture
struct Lock_Screen_CaptureViewFinder: UIViewControllerRepresentable {
let session: LockedCameraCaptureSession
var sourceType: UIImagePickerController.SourceType = .camera
init(session: LockedCameraCaptureSession) {
self.session = session
}
func makeUIViewController(context: Self.Context) -> UIImagePickerController {
let imagePicker = UIImagePickerController()
imagePicker.sourceType = sourceType
imagePicker.mediaTypes = [UTType.image.identifier, UTType.movie.identifier]
imagePicker.cameraDevice = .rear
return imagePicker
}
func updateUIViewController(_ uiViewController: UIImagePickerController, context: Self.Context) {
}
}
Then I have my widget:
struct CameraWidgetControl: ControlWidget {
var body: some ControlWidgetConfiguration {
StaticControlConfiguration(
kind: "com.myCompany.myAppName.lock-screen") {
ControlWidgetButton(action: MyAppCaptureIntent()) {
Label("Capture", systemImage: "camera.shutter.button.fill")
}
}
}
}
My AppIntent:
struct MyAppContext: Codable {}
struct MyAppCaptureIntent: CameraCaptureIntent {
typealias AppContext = MyAppContext
static let title: LocalizedStringResource = "MyAppCaptureIntent"
static let description = IntentDescription("Capture photos and videos with MyApp.")
@MainActor
func perform() async throws -> some IntentResult {
.result()
}
}
The Issue
LockedCameraCapture Widget does not launch my app when tapped from locked screen. You get the Face ID prompt and takes you to just Home Screen. But when the same widget is in the Control Center, it launches the app successfully.
Error Message
When tapped on Lock Screen, I get the following error code:
LaunchServices: store ‹private > or url ‹private > was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database"
UserInfo=&NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Attempt to map database failed: permission was denied. This attempt will not be retried.
Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database"
UserInfo=&NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Things I tried
Widget image displays correctly
App ID and the Provisioning Profile seem to be fine since they work fine when the same code injected in to AVCam sample app and when used the same App ID's.
AppIntent file contains the target memberships of the Lock Screen capture and Widget
Apple compiles without errors or warnings.
If you use UISceneDelegate's scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) to handle deep links (such as tapping a widget) you might run into an issue where this callback is called twice in the majority of cases.
If you push a view controller in response to this, you might end up with two pushed view controllers, if you do not mitigate this. This is exclusively an issue in iOS 26.0 and works as expected on iOS 18.
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
/// Add any widget to the home screen that uses the widgetURL modifier and tap them. Most of the time, openURLContexts() will get called twice.
/// If you run this project on iOS 18, it's *always* called once as expected.
print("openURLContexts \(URLContexts)")
}
Filed as FB20301454
Create a static widget kit based widget for watchKit. Use swiftUI and an image.
IE on 42mm you can import a 141x141 image at 2x. Import a 141x141 image in the widget and load it in swiftUI.
In watchOS 11.x simulator the image will allow up to the size for X Large circles, and on os26, it will not load and complain the image is too large and report the area for the smaller circle, IE 89x89 @ 2x for 41mm
Also submitted a "feedback" ticket FB20506200
This is a big issue b/c the size difference for X large circles v the smaller circles is really large.
To get existing images to load I am having to resize them down 75-80% on OS26 in the X Large complication.
I'm having problems with my released app with iOS & WatchOS 26 support.
I've added AppIntentConfiguration support in the WatchOS app such that users can configure the complication. My complications also support multiple families and so I have slightly different configuration options available if its in the .accessoryRectangular slot or the .accessoryCircular one.
This works fine on Apple Watch when editing the Watch face. Here you can then select the configuration options fine and they are correct for the different variants.
However on iOS when configuring in the Apple Watch app on iPhone, the different complication size is ignored and the same configuration options are offered meaning they are wrong for one of them.
I created a sample project, here is the app intent code:
struct TestWidgetConfigurationIntent: AppIntent, WidgetConfigurationIntent {
static var title: LocalizedStringResource = "New Widgets with Configuration"
static var description = IntentDescription("Lots of stuff.")
static var isDiscoverable: Bool { return false}
init() {}
func perform() async throws -> some IntentResult {
return .result()
}
@Parameter(title: "Enable More Detail", default: true)
var moreDetail: Bool
@Parameter(title: "Enable Other Parameter", default: true)
var otherParameter: Bool
static var parameterSummary: some ParameterSummary {
When(widgetFamily: .equalTo, .accessoryRectangular) {
Summary("Test Info") {
\.$moreDetail
\.$otherParameter
}
} otherwise : {
Summary("Test Info") {
\.$moreDetail
}
}
}
}
In WatchOS you get the correct configuration options:
In iOS you do not, you get the same configuration option regardless of which family size you select:
This could be a bug so I've filed feedback FB20328319. Otherwise if anyone has insights, it would be very appreciated. This is all tested on the current iOS 26.0 and WatchOS 26.0 versions. Thanks!
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
WatchKit
watchOS
WidgetKit
App Intents
I noticed that with iOS 18, when adding a widget to the Control Center, there is now some "grouping system". I'm interested in the Capture group, which contains native widgets from Apple as well as third party apps like Instagram and Blackmagic cam, widgets in this group open the camera. My widget also opens the camera in my app, how can I add it to this group?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
SwiftUI
WidgetKit
App Intents
The Widget Image display on iOS26 transparency mode is blank
Both of these writing methods show blank Spaces. Is there a problem with my code or a bug in the system?
The current compilation environment is Xcode Version 16.3 (16E140) iOS26.0
I’m testing .glassEffect() in a widget on the latest iOS 26 beta, but it seems to have no effect at all — the blur isn’t visible, and in some cases even white text disappears completely.
Is this the expected behavior for widgets (i.e. glass effect is not supported), or could this be a bug in the beta?
Would appreciate any clarification or pointers. Thanks!
my dynamic island UI is triggering as empty when i send my curl, this is a pushToStart run push driven live activity and when i send my curl this is what appears, despite be being able to render the UI through a local push no problem, here is my curl.
curl -v \
-H "apns-topic: MuscleMemory.KimchiLabs.com.push-type.liveactivity" \
-H "apns-push-type: liveactivity" \
-H "apns-priority: 10" \
-H "Content-Type: application/json" \
-H "authorization: bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IjI4MjVTNjNEV0IifQ.eyJpc3MiOiJMOTZYUlBCSzQ2IiwiaWF0IjoxNzU4ODU2MDkyfQ.i83VbgROsxEzdgr512iQkVsp0FjHIoHq2L6IB2aL1fImJgX-XM6TM5frNnVyfva7haMd9fDGjO2D_wfCq8WnBg" \
--data '{
"aps": {
"timestamp": '"$now"',
"event": "start",
"content-state": {
"plain_text": "hello world",
"userContentPage": ["hello world"]
},
"attributes-type": "KimchiKit.DynamicRepAttributes",
"attributes": {
"activityID": "12345"
},
"alert": {
"title": "Workout started",
"body": "We’ll show your reps on the Lock Screen.",
"sound": "default"
}
}
}' \
--http2 https://api.sandbox.push.apple.com/3/device/80d50a03472634d9381b729deec58a3e250ea0006b7acd7c2d6ef19e553dcdb010eb1434ff9a6907380f6ed3e9276d57d58f3cda3ac9fc3bea67abae116601a63ec77a34174fd271c4151ec898abae30
and heres my content state which resides in a shared module
@available(iOS 17.0, *)
public struct DynamicRepAttributes: ActivityAttributes, Codable {
public struct ContentState: Codable, Hashable {
public var plainText: String
public var userContentPage: [String]
public enum CodingKeys: String, CodingKey {
case plainText = "plain_text"
case userContentPage
}
public init(plainText: String, userContentPage: [String]) {
self.plainText = plainText
self.userContentPage = userContentPage
}
}
public var activityID: String
public init(activityID: String) {
self.activityID = activityID
}
}
Ive also alr verified my attributes type is correct, have been stuck on this issue would really appreciate the help
I'm using the LockedCameraCaptureExtension to launch my Camera app from the camera button. Some of our users report our app crashing a few seconds after being launch from the camera button.
The call stack is something inside BoardServices [BSServicesConfiguration activateXPCService]
I'm not sure how to investigate or fix this, anyone else having the same issue?
Basically in my LockedCameraCaptureExtension when it loads I just call openApplication on the LockedCameraCaptureSession to launch into my app.
@main
struct captureExtension: LockedCameraCaptureExtension {
var body: some LockedCameraCaptureExtensionScene {
LockedCameraCaptureUIScene { session in
Button(action: {
Task {
await openCamera(session: session)
}
}, label: {
Text("Open Camera")
})
.buttonStyle(PlainButtonStyle())
.task {
await openCamera(session: session)
}
}
}
private func openCamera(session: LockedCameraCaptureSession) async {
try? await session.openApplication(for: NSUserActivity(activityType: "com.mycompany.camera"))
}
}
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.
Documentation seems to say that privacySensitive is supposed to redact on the lockScreen. I've disabled "Allow Access when locked" for "Lock Screen Widgets" just in case. It does not work for me. If I add "redacted(reason:) into the view hierarchy it redacts all the content all the time including on the home screen. I've read articles. I gone through a lot of documentation. None of them seem to give the magic formula for redacting sensitive content on the lock screen.
I'm using iOS 18.7 on a real iPhone 14 Pro Max.
Attachments:
Problem Description:
I encountered an issue related to WidgetKit.
Inside a widget, I used the following API:
UIImage(named: "some_pic_in_asset")!
However, in my crash monitoring system, I observed a large number of crashes caused by force-unwrapping a UIImage that could not be loaded.
After analyzing the crash reports and the associated app version information, I found that this issue consistently occurs during the app upgrade process.
For example:
A user installs the app at version A and adds the widget to their Home Screen.
Later, the app is upgraded to version A+1.
Then, in the monitoring backend, I observe many crashes. The crash itself happens under version A, but the report is uploaded under version A+1.
Since crash collection happens in the widget and the report is uploaded by the app, the version mismatch is understandable. I also confirmed that the number of crashes strongly correlates with the number of app version upgrades.
Based on this analysis, I believe that in the upgrade scenario described above, UIImage(named: "some_pic_in_asset") sometimes fails to load the image even though it exists in the asset catalog. Please note that the force-unwrapping operation is not the focus of my concern here.
Question:
Is this a known system issue?
If so, is there a plan for fixing it in future iOS updates?
Hi everyone,
so I have a widget that is loading and showing images.
When changing my icons and widget to transparent or tinted on iOS 26 they just turn white or the tint color.
How can I mark images to preserve their appearance aka color?
The Fotos widget has (long press and its configuration) and option to tint them or preserve the color. I just can't figure out how it's done and what API to use.
Second, is there an API to learn which mode is currently being used to tweak other elements of the UI?
Thanks for any advice.