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.
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
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.
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?
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.
Description
When starting Live Activities via ActivityKit push notifications, the “start” notification is received correctly on iPhone 16 Pro Max, but subsequent update or end push notifications are not. The same implementation on iPhone 16 Pro behaves as expected (both start and update/end notifications are delivered and processed).
Environment Property Value
Device (failing) iPhone 16 Pro Max
Device (working) iPhone 16 Pro
iOS Version 18.5
Xcode / SDK 16.2/ActivityKit / Push Notifications
Network Wi-Fi / Cellular (both tested)
Data Collection Method
Devices connected via USB.
Logs captured using Console.app.
Log filtering applied for the liveactivitiesd daemon to isolate Live Activity behavior.
Initial Triage/Observations
Payload format confirmed compatible; no incompatible fields.
APNs token remains the same across messages (no refresh).
Identical ActivityKit subscriptions/participants on both devices.
Server-side delivery is confirmed: iPhone 16 Pro receives all messages (start, update, end).
Only iPhone 16 Pro Max fails to receive update or end push notifications.
Log Analysis
iPhone 16 Pro (Working)
Push-to-Start successfully received:
13:45:20 - APSXPCDeliverMessageEvent: Created APSIncomingMessage
13:45:20 - Received message: eventType: start(SessionPushNotifications.IncomingMessage.EventType.StartParameters(attributesType:
"AchToLSUpgradeAttributes", attributesData: 125 bytes, inputs: []))
13:45:20 - Created activity: 1C081AC5-01AE-4EC0-8B67-5F2A9FAE2D60
13:45:45 - APSXPCDeliverMessageEvent: Created APSIncomingMessage
13:45:45 - Received message: eventType: end(dismissDate:
Optional(2025-07-21 21:00:44 +0000))
13:45:20 - Activity updated: 1C081AC5-01AE-4EC0-8B67-5F2A9FAE2D60
13:45:20 - Local activity did update: 1C081AC5-01AE-4EC0-8B67-5F2A9FAE2D60
iPhone 16 Pro Max (Failing)
13:56:39 - APSXPCDeliverMessageEvent: Created APSIncomingMessage
13:56:39 - Received message: eventType: start(SessionPushNotifications.IncomingMessage.EventType.StartParameters(attributesType:
"AchToLSUpgradeAttributes", attributesData: 125 bytes, inputs: []))
13:56:39 - Created activity: E6BBF691-0C7A-4791-98D2-6F1440D9932E
**No subsequent APNs push-to-update or push-to-end messages received.**
13:56:39 - No destinations for event E6BBF691... of type start
13:56:40 - No destinations for event E6BBF691... of type update
Questions for Apple Engineering
Are there known issues with ActivityKit push notifications specifically on iPhone 16 Pro Max devices?
What additional diagnostic logs (system, APNs, liveactivitiesd) would be most helpful to collect?
Could device-specific power management, notification settings, or OS-level changes on Pro Max models affect Live Activity updates?
Are there differences in how Live Activity push subscriptions or routing are handled on iPhone 16 Pro Max vs Pro that could lead to this issue?
New features in WatchOS 26 with configurable widgets make it more important than ever that apps adopt IntentConfiguration options where applicable.
I develop an app with an Apple Watch complication/widget on many many user's Watch faces around the world. I've completed updating my code to support WidgetKit and remove ClockKit.
However, I face huge issues adding support for users to configure their widget/complications.
If I update a widget to go from StaticConfiguration to IntentConfiguration, even when keeping the "kind" string the same, the widget disappears from the Watch face.
This is an unacceptable user experience meaning I can't proceed with the migration. The problem is users will expect me to offer configuration in the Watch face soon for their widget/complication. Currently this process is done in a sub-optimal way in the app itself.
A similar issue exists on iOS where the widget will just "freeze" indefinitely is migrated.
This issue still occurs on the iOS 26 and WatchOS 26 betas.
So how to move this forward.
This has been discussed previously here: https://developer.apple.com/forums/thread/661247
I've mentioned it at WidgetKit labs
I've filed feedback last year: FB13880020
I've filed feedback this year: FB18180368
It seems really important this gets fixed for developers to adopt these new features, is there any other migration route I'm missing or a workaround that would mitigate this seemingly big problem.
Good morning everyone!
Today I have a question about using SwiftData with CloudKit and Widgets. I recently set up my project for SwiftData and CloudKit synchronization, but for some reason, I’m not able to give my Widget access to this data. CloudKit works perfectly fine for my main app, but the Widget only shows placeholder data(the placeholder data which were defined in the get functions as catch, this is sure).
I have set the CloudKit capability for my Widget extension and tried fetching data with the get-functions in the code below. I also ensured that the data model files are members of the Widget extension target and that the Widget extension uses the same CloudKit container as the main app.
I wondered if it is possible and reasonable to save a copy of my CloudKit data in an App Group container, but in that case, the information shown in the Widget are not always up-to-date, so a solution that fetches data directly from CloudKit would be better. Has anyone had experience with this case? I couldn’t find much information about this problem online.
In the code below, many parts have been deleted or altered because they are not relevant to the problem, as they don’t fetch data. The variables, functions, and data models in the code may sometimes have German names, but I hope you can still understand it.
Thanks for your help!
struct Provider: AppIntentTimelineProvider {
//[Placeholder and snapshot]
func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline<CleverEntry> {
let entry = await loadAllVariables()
return Timeline(entries: [entry], policy: .after(Date().addingTimeInterval(60 * 5)))
}
@MainActor
private func getExam() -> [PruefungM] {
//Old, local version
/*
guard let modelContainer = try? ModelContainer(for: PruefungM.self) else {
return []
}
let descriptor = FetchDescriptor<PruefungM>()
let PRF = try? modelContainer.mainContext.fetch(descriptor)
return PRF ?? []
*/
do {
let configuration = ModelConfiguration(cloudKitDatabase: .private("iCloud.my_bundle_id"))
let container = try ModelContainer(
for: PruefungM.self,
configurations: configuration
)
let descriptor = FetchDescriptor<PruefungM>()
return try container.mainContext.fetch(descriptor)
} catch {
print("❌ Error(CloudKit): \(error)")
return []
}
}
@MainActor
private func getHAF() -> [HausaufgabeM] {
do {
let configuration = ModelConfiguration(cloudKitDatabase: .private("iCloud.my_bundle_id"))
let container = try ModelContainer(
for: HausaufgabeM.self,
configurations: configuration
)
let descriptor = FetchDescriptor<HausaufgabeM>()
return try container.mainContext.fetch(descriptor)
} catch {
print("❌ Error (CloudKit): \(error)")
return []
}
}
@MainActor
private func loadAllVariables() -> CleverEntry {
print("Function started")
let HAF = getHAF()
let PRF = getExam()
//handling and returning the data
}
}
Hello everyone,
I'm developing an app for iOS 18 using SwiftData, with iCloud synchronization enabled. My app also includes an interactive widget that allows users to mark tasks as complete, similar to Apple's Reminders widget.
I'm facing a specific issue with how iCloud sync is triggered when changes are made from the widget.
My Setup:
Xcode 16
Swift 6 / iOS 18
SwiftData with iCloud Sync enabled.
An interactive widget using App Intents to modify the SwiftData model.
What's working correctly:
App to Widget (Same Device): If I mark a task as complete in the main app, the widget on the same device updates instantly.
Widget to App (Same Device): If I mark a task as complete using the interactive widget, the main app on the same device reflects this change immediately.
App to App (Across Devices): If I make a change in the app on my iPhone, it syncs correctly via iCloud and appears in the app on my iPad.
The Problem:
The synchronization issue occurs specifically when an action is initiated from the widget and needs to be reflected on other devices, or when a change from another device needs to be reflected in the widget.
Widget Change Not Syncing to Other Devices: If I mark a task as complete in the widget on my iPhone, the change does not sync to my iPad. The task on the iPad only updates after I manually open the main app on the iPhone.
Remote Change Not Syncing to Widget: Similarly, if I mark a task as complete in the app on my iPad, the widget on my iPhone does not update to show this change. The widget only refreshes with the correct state after I open the main app on the iPhone.
It seems that the widget's AppIntent correctly modifies the local SwiftData store, but this action isn't triggering the necessary background process to push the changes to iCloud. The sync only seems to happen when the main app, with its active ModelContainer, is brought to the foreground.
My goal is for any change made in the widget to be reflected across all of the user's devices in near real-time, without requiring them to launch the main app to initiate the sync.
Is there a specific API I need to call from my AppIntent to force a SwiftData sync, or a project capability I might be missing to allow the widget extension to trigger iCloud pushes?
Any help or guidance would be greatly appreciated.
Thank you!
When I was developing the visionOS 26beta Widget, I found that it could not work normally when the real vision OS was running, and an error would appear.
Please adopt container background api
It is worth mentioning that this problem does not occur on the visionOS virtual machine.
Does anyone know what the reason and solution are, or whether this is a visionOS error that needs Feedback? Thank you!
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