Team-scoped keys introduce the ability to restrict your token authentication keys to either development or production environments. Topic-specific keys in addition to environment isolation allow you to associate each key with a specific Bundle ID streamlining key management.
For detailed instructions on accessing these features, read our updated documentation on establishing a token-based connection to APNs.
Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
Hello,
I have a iOS app I was looking at porting to Mac.
I'm having an issue with both the Mac (Designed for iPad) and Mac Catalyst Destinations. I can't test Mac due to too many build issues.
I'm trying to assign a new NSManagedObject into a NSPersistentStore.
let object = MyObject(context: context)
context.assign(object, to: nsPersistentStore)
This works fine for iOS/iOS Simulator/iPhone/iPad. But on the Mac it's crashing with
FAULT: NSInvalidArgumentException: Can't assign an object to a store that does not contain the object's entity.; {
Thread 1: "Can't assign an object to a store that does not contain the object's entity."
I'm implementing payment processing with Apple Pay on the web, but I've been stuck right at the final step of the flow: decrypting the payment data sent by Apple.
Here is a summary of my implementation:
The backend language is Java. The frontend portal requests the session and performs the payment using the endpoints exposed by the backend. I created .p12 files from the .cer files returned by the Apple Developer portal for both certificates (Merchant Identity and Payment Processing) and I'm using them in my backend.
The merchant validation works perfectly; the user is able to request a session and proceed to the payment sheet.
However, when the frontend sends the encrypted token back to my sale endpoint, the problem begins. My code consistently fails when trying to decrypt the data (inside the paymentData node) throwing a javax.crypto.AEADBadTagException: Tag mismatch!
I can confirm that the certificate used by Apple to encrypt the payment data is the correct one. The hash received from the PKPaymentToken (header.publicKeyHash) object exactly matches the hash generated manually on my side from my .p12 file.
In the decryption process, I'm using Bouncy Castle only to calculate the Elliptic Curve (ECC) shared secret. For the final AES-GCM decryption, I am using Java's native provider since I already have the bytes of the shared secret calculated. (Originally, I was doing it entirely with BC, but it failed with the exact same error).
We have exhaustively verified our cryptographic implementation:
We successfully reconstruct the ephemeralPublicKey and compute the ECDH Shared Secret using our Payment Processing Certificate's private key (prime256v1).
We perform the Key Derivation Function (KDF) using id-aes256-GCM, PartyU as Apple, and counter 00000001.
For PartyV, we have tried calculating the SHA-256 hash of our exact Merchant ID string.
We also extracted the exact ASN.1 hex payload from the certificate's extension OID 1.2.840.113635.100.6.32 and used it as PartyV.
We have tried generating brand new CSRs and Processing Certificates via OpenSSL directly from the terminal.
Despite having the correct ECDH shared secret (and confirming Apple used our public key via the hash), the AES tag validation always fails.et, the AES tag validation always fails.
Given that the math seems correct and the public key hashes match, could there be an environment mismatch (Sandbox vs. Production) or a domain validation issue causing Apple to encrypt the payload with a dummy PartyV or scramble the data altogether?
Any guidance on this behavior or the exact PartyV expected in this scenario would be highly appreciated.
I have started from here: Apple's guide on the sharing core data objects between iCloud users and I have created a sample project that has Collections and Items. Everything works great while I stay on Swift 5, like with the initial project.
I would like to migrate to Swift 6 (Default Actor Isolaton @MainActor, Approachable Concurrency: Yes) on the project and I am stuck at extension CDCollection: Transferable { ... }. When compiling with Swift 5, there is a warning: Conformance of 'NSManagedObject' to 'Sendable' is unavailable in iOS; this is an error in the Swift 6 language mode.
After resolving almost all compile-time warnings I'm left with:
Conformance of 'CDCollection' to protocol 'Transferable' crosses into main actor-isolated code and can cause data races.
Which I don't think will work, because of the warning shown above. It can be worked around like:
nonisolated extension CDCollection: Transferable, @unchecked Sendable
Then there are errors:
let persistentContainer = PersistenceController.shared.persistentContainer Main actor-isolated static property 'shared' can not be referenced from a nonisolated context.
I've created the following class to have a Sendable object:
struct CDCollectionTransferable: Transferable {
var objectID: NSManagedObjectID
var persistentContainer: NSPersistentCloudKitContainer
public static var transferRepresentation: some TransferRepresentation {
CKShareTransferRepresentation { collectionToExport in
let persistentContainer = collectionToExport.persistentContainer
let ckContainer = CloudKitProvider.container
var collectionShare: CKShare?
if let shareSet = try? persistentContainer.fetchShares(
matching: [collectionToExport.objectID]),
let (_, share) = shareSet.first
{
collectionShare = share
}
/**
Return the existing share if the collection already has a share.
*/
if let share = collectionShare {
return .existing(share, container: ckContainer)
}
/**
Otherwise, create a new share for the collection and return it.
Use uriRepresentation of the object in the Sendable closure.
*/
let collectionURI = collectionToExport.objectID
.uriRepresentation()
return .prepareShare(container: ckContainer) {
let collection = await persistentContainer.viewContext
.perform {
let coordinator = persistentContainer.viewContext
.persistentStoreCoordinator
guard
let objectID = coordinator?.managedObjectID(
forURIRepresentation: collectionURI
)
else {
fatalError(
"Failed to return the managed objectID for: \(collectionURI)."
)
}
return persistentContainer.viewContext.object(
with: objectID
)
}
let (_, share, _) = try await persistentContainer.share(
[collection],
to: nil
)
return share
}
}
}
}
And I'm able to compile and run the app with this change:
let transferable = CDCollectionTransferable(
objectID: collection.objectID,
persistentContainer: PersistenceController.shared
.persistentContainer
)
ToolbarItem {
ShareLink(
item: transferable,
preview: SharePreview("Share \(collection.name)!")
) {
MenuButtonLabel(
title: "New Share",
systemImage: "square.and.arrow.up"
)
}
}
The app crashes when launched with
libdispatch.dylib`_dispatch_assert_queue_fail:
0x1052c6ea4 <+0>: sub sp, sp, #0x50
0x1052c6ea8 <+4>: stp x20, x19, [sp, #0x30]
0x1052c6eac <+8>: stp x29, x30, [sp, #0x40]
0x1052c6eb0 <+12>: add x29, sp, #0x40
0x1052c6eb4 <+16>: adrp x8, 63
0x1052c6eb8 <+20>: add x8, x8, #0xa0c ; "not "
0x1052c6ebc <+24>: adrp x9, 62
0x1052c6ec0 <+28>: add x9, x9, #0x1e5 ; ""
0x1052c6ec4 <+32>: stur xzr, [x29, #-0x18]
0x1052c6ec8 <+36>: cmp w1, #0x0
0x1052c6ecc <+40>: csel x8, x9, x8, ne
0x1052c6ed0 <+44>: ldr x10, [x0, #0x48]
0x1052c6ed4 <+48>: cmp x10, #0x0
0x1052c6ed8 <+52>: csel x9, x9, x10, eq
0x1052c6edc <+56>: stp x9, x0, [sp, #0x10]
0x1052c6ee0 <+60>: adrp x9, 63
0x1052c6ee4 <+64>: add x9, x9, #0x9db ; "BUG IN CLIENT OF LIBDISPATCH: Assertion failed: "
0x1052c6ee8 <+68>: stp x9, x8, [sp]
0x1052c6eec <+72>: adrp x1, 63
0x1052c6ef0 <+76>: add x1, x1, #0x9a6 ; "%sBlock was %sexpected to execute on queue [%s (%p)]"
0x1052c6ef4 <+80>: sub x0, x29, #0x18
0x1052c6ef8 <+84>: bl 0x105301b18 ; symbol stub for: asprintf
0x1052c6efc <+88>: ldur x19, [x29, #-0x18]
0x1052c6f00 <+92>: str x19, [sp]
0x1052c6f04 <+96>: adrp x0, 63
0x1052c6f08 <+100>: add x0, x0, #0xa11 ; "%s"
0x1052c6f0c <+104>: bl 0x1052f9ef8 ; _dispatch_log
0x1052c6f10 <+108>: adrp x8, 95
0x1052c6f14 <+112>: str x19, [x8, #0x1f0]
-> 0x1052c6f18 <+116>: brk #0x1
The app still crashes when I comment this code, and all Core Data related warnings.
I'm quite stuck now as I want to use Swift 6.
Has anyone figured CloudKit, CoreData and Swift 6 for sharing between users?
My phone says ‘Slow Charger’ even if it’s Apple original power adaptor and cable. It‘s new and i think it’s a software issue. If it is then please fix it. If it’s not i’ll try fixing it myself. And a few things that i don’t like about iOS 26.4 are: Overheating, Safari Bugs, Apple Music UI not working. Please also try to fix them.
I am running postfix on macOS Sequoia, and need it to log
any kind of error to fix them.
I found that in this version of macOS, syslogd is configured
with the file /etc/asl/com.apple.mail, which contains:
# mail facility has its own log file
? [= Facility mail] claim only
> /var/log/mail.log mode=0644 format=bsd rotate=seq compress file_max=5M all_max=50M
* file /var/log/mail.log
which is its install configuration and seems correct.
Postfix is started ( by launchd ) and running ( ps ax | grep master ), but on sending
errors occur, and nothing is logged.
How to make postfix to log in /var/log/mail.log
which is the normal way on millions of postfix servers
around the world?
Topic:
App & System Services
SubTopic:
Core OS
Hi,
ios 26.4 beta
iPhone 13 Pro Max
After I installed this beta - my lost an opportunity of fas charge. I tried different cables and blocks - nothing. Now it says - "slow charge" and to charge from 20% to 80% I need more than 2 hours.
Topic:
App & System Services
SubTopic:
Core OS
When asking Siri to run a shortcut, it will spawn two processes called BackgroundShortcutRunner that do not die when the shortcut is done running. If the Siri window is on screen when I speak to have the shortcut run it does not spawn those two processes. However if the Siri window is not on screen when I speak, the Siri window appears and spawns these two processes. The two processes do not terminate once the shortcut is done running. I now have over 200 these processes since rebooting three days ago to install 26.4.
FB22015192
Topic:
App & System Services
SubTopic:
Automation & Scripting
I have a BLE device which my app connects to and can detect button presses. On a button press, I want my app to start recording using the AudioRecordingIntent. But my app doesn't work and throws a background error. Is there any reliable way I can get the app to start recording audio in the background?
Topic:
App & System Services
SubTopic:
Hardware
Tags:
AVAudioEngine
Core Bluetooth
Intents
App Intents
Hello,
We are implementing in-app provisioning in our fintech app; the card issuer is a third party, so we have limited control and visibility. We have ruled out the causes we could investigate on our side and on the card issuer’s side.
We are reaching out to ask for your help in understanding what is going wrong so we can fix it.
What happens:
User taps “Add to Apple Wallet” → we present PKAddPaymentPassViewController → they tap Next → after a few seconds the flow fails with "Set Up Later" alert.
Device log:
ProvisioningOperationComposer: Step 'eligibility' failed with error <PKProvisioningError: severity: 'terminal'; internalDebugDescriptions: '(
"eligibility request failure",
"Received HTTP 500"
)'; underlyingError: 'Error Domain=PKPaymentWebServiceErrorDomain Code=0 "Unexpected error." UserInfo={PKErrorHTTPResponseStatusCodeKey=500, NSLocalizedDescription=Unexpected error.}'; userInfo: '{
PKErrorHTTPResponseStatusCodeKey = 500;
}';
Feedback Assistant ID: FB22007923 (Error during the In-App Provisioning process)
Should there be separate intents to open each supported file type? Or a single intent, and my code sniffs out the format?
On Sequoia, I want to configure my postfix as a server.
And for this I have to change the way postfix is started from:
/System/Library/LaunchDaemons/com.apple.postfix.master.plist
But this file is on the read only / file system.
Then I just unloaded this startup, and made a new one
in:
/Library/LaunchDaemons/com.apple.postfix.master.plist
and I was able to start it.
But on the next system boot, the system one in
/System/Library/LaunchDaemons
was started again.
How should I cleanly and permanently achieve this server basic modification?
Topic:
App & System Services
SubTopic:
Core OS
I have the following code running on macOS and iOS:
CKQuerySubscription *zsub = [[CKQuerySubscription alloc] initWithRecordType:ESS_CLOUDCONTROLLER_RECORDTYPE_PUSHNOTE predicate:[NSPredicate predicateWithFormat:@"TRUEPREDICATE"] subscriptionID:@"pushZSub" options:CKQuerySubscriptionOptionsFiresOnRecordUpdate|CKQuerySubscriptionOptionsFiresOnRecordCreation|CKQuerySubscriptionOptionsFiresOnRecordDeletion];
zsub.zoneID = zid;
CKNotificationInfo *inf = [[CKNotificationInfo alloc] init];
inf.shouldSendContentAvailable = YES;
inf.desiredKeys = @[ESS_PN_RECORDFIELD_KEY_OVERALLDATE];
zsub.notificationInfo = inf;
CKModifySubscriptionsOperation *msop = [[CKModifySubscriptionsOperation alloc] initWithSubscriptionsToSave:@[zsub] subscriptionIDsToDelete:nil];
msop.qualityOfService = NSQualityOfServiceUserInitiated;
msop.modifySubscriptionsCompletionBlock = ^(NSArray<CKSubscription *> * _Nullable savedSubscriptions, NSArray<CKSubscriptionID> * _Nullable deletedSubscriptionIDs, NSError * _Nullable operationError) {
dispatch_async(dispatch_get_main_queue(), ^{
if (savedSubscriptions.count == 1) { //works also when already created.
compH(YES, nil);
} else {
compH(NO, nil);
}
});
};
[self.database addOperation:msop];
(code synopsis: after i create a custom zone (not shown in code), I add a ckquerysubscription to it for a specific record type, configured as a silent notification)
When I change the according record in my Mac app, I get an immediate silent push on iOS.
On macOS, however, after I change the record in my iOS app, I don't get one. Sometimes, one silent push makes it through every now and then a minute+ late or so, and after that, it's going missing again.
What's the deal? Everything's set up correctly (com.apple.developer.aps-environment is set, container-identifiers are the same, icloud services are the same, ubiquity-kvstore-identifier are the same).
I obviously register for remote notifications in both apps. I see all the records and subscriptions and zones in both the Mac and iOS app.
I tried setting alertBody to an empty string, or soundName to an empty string, or both to an empty string: no difference
I tried having different subscriptions for my Mac and iOS app, since they use different bundle ids, but that was merged into one subscription server-side, so I'm thinking that's not it
I tried making it not-silent by setting contentAvailable to NO and adding a full alertBody, title and subtitle. Again, worked on iOS, not on macOS.
This has been going on since macOS 14 Sonoma (when I first got reports of this. Now running on macOS 26.3). Before Sonoma, it worked just fine.
Now I thought perhaps it's because I had a subscription on the default zone, and not a custom one, so I tried subscribing to changes on a record in a custom zone (see code above), but that did not change anything either.
It's all working fine, only the push notifications are not making it through to the Mac app.
If I sudo killall apsd (kill the push service daemon), the last push notification suddenly miraculously makes it through, by the way.
At this point, I'm out of ideas and would very much appreciate pointers as to how to debug this. Polling every 30 seconds for changes is so 1990s.
Speaking of which, this is a rather long-time-running app (started in 2011). Could my CloudKit database be “too old” or “corrupted” or whatever?
Thank you kindly,
– Matthias
Hi there,
I’ve been having ongoing issues with my Apple Watch. Last week I updated it to watchOS 26.3. The next day it accidentally ran out of battery, and since then it has been randomly restarting, showing an overheating message.
I suspected it might be related to the update, so I researched online and on the official Apple forums. People recommended resetting the Apple Watch and unpairing it from my iPhone. I did both procedures, but the problem persists, even when the watch is in a cool environment.
I’ve been using it normally, but it still restarts multiple times a day. Yesterday I even updated to the public beta of watchOS 26.4 hoping it would fix the issue, but it didn’t help — the random restarting continues. Today I also unpaired and paired it again with my iPhone, and the problem is still happening.
This has been very disruptive and frustrating.
I’m following up on my previous message because I’ve found additional diagnostic information that may help identify the cause of the issue.
I accessed the Apple Watch analytics logs and noticed that the restarts appear to be associated with a system process crash, specifically the ActivityMonitorApp (com.apple.ActivityMonitorApp). The log shows an EXC_RESOURCE exception with subtype MEMORY and the message “(Limit 35 MB) Crossed High Water Mark.”
Based on this, it seems the system process exceeded its memory limit and was terminated by the system. This happens shortly before the watch displays the overheating icon and restarts.
This makes me suspect the overheating warning may not be caused by actual temperature, but instead may be related to a software or system issue introduced after the watchOS update.
For reference, the watch is currently running:
watchOS 26.4 (build 23T5209m)
I’d also like to share that I’ve performed some additional troubleshooting steps to help isolate the issue.
Based on the crash logs referencing the ActivityMonitorApp, I removed the Activity rings complication from my main watch face and disabled Activity app notifications as well.
I’ll be monitoring the watch closely today to see if this resolves the issue. If the restarts happen again, I will also try to capture additional logs to provide you with more information.
Hey y'all,
I'm reaching out because of an observed issue that I am experience both in sandbox and in production environments. This issue does not occur when using the Local StoreKit configurations.
For context, my app only implements auto-renewing subscriptions. I'm trying to track with my own analytics every time a successful purchase is made, whether in the app or externally through Subscription Settings. I'm seeming too many events for just one purchase.
My app is observing Transaction.updates. When I make a purchase with Product.purchase(_:), I successfully handle the purchase result. After about 10-20 seconds, I receive 2-3 new transactions in my Transaction.updates, even though I already handled and finished the Purchase result. This happens on production, where renewals are one week. This also happens in Sandbox, where at minimum renewals are every 3 minutes.
The transactions do not differ in transactionId, revocationDate, expirationDate, nor isUpgraded... so not sure why they're coming in through Transaction.updates if there are no "updates" to be processing.
For purchases made outside the app, I get the same issue. Transaction gets handled in updates several times.
Note that this is not an issue if a subscription renews. I use `Transaction.reason
I want to assume that StoreKit is a perfect API and can do no wrong (I know, a poor assumption but hear me out)... so where am I going wrong?
My current thought is a Swift concurrency issue. This is a contrived example:
// Assume Task is on MainActor
Task(priority: .background) { @MainActor in
for await result in Transaction.updates in {
// We suspend current process,
// so will we go to next item in the `for-await-in` loop?
// Because we didn't finish the first transaction, will we see it again in the updates queue?
await self.handle(result)
}
}
@MainActor
func handle(result) async {
...
await Analytics.sendEvent("purchase_success")
transaction.finish()
}
Hey y'all,
I'm reaching out because of an observed issue that I am experience both in sandbox and in production environments. This issue does not occur when using the Local StoreKit configurations.
For context, my app only implements auto-renewing subscriptions. I'm trying to track with my own analytics every time a successful purchase is made, whether in the app or externally through Subscription Settings. I'm seeming too many events for just one purchase.
My app is observing Transaction.updates. When I make a purchase with Product.purchase(_:), I successfully handle the purchase result. After a few seconds, I receive 2-3 new transactions in my Transaction.updates, even though I already handled and finished the Purchase result.
The transactions seem to have the same transactionId, and values such as revocationDate, expirationDate, and isUpgraded don't seem to change between any of them.
For purchases made outside the app, I get the same issue. Transaction gets handled in updates several times.
Note that this is not an issue if a subscription renews. I use `Transaction.reason
After upgrading to a new iPhone and restoring from an iCloud backup using the same Apple ID, I noticed an issue with Health app permissions.
■ What is happening
On my previous iPhone, an app had permission to read step count data.
After restoring to the new iPhone, the app still appears in the Health app under Sources.
However, when I tap the app, the usual data type permission toggles (such as Steps) are not displayed at all.
As a result, the app is unable to read step count data.
■ Additional details
The app itself seems to be recognized as a Health data source.
However, the data type permission screen is empty.
No ON/OFF switches are shown.
The backup was created on iOS 18, and the restore was performed on iOS 26.
I have not yet confirmed whether this also happens with other iOS version combinations.
■ Questions
Is it expected behavior that Health app permissions (per data type) are not restored via iCloud backup?
Has anyone experienced a similar situation where the app appears under Sources but the permission options are missing? If so, how did you resolve it?
Any information from users who have experienced the same issue would be greatly appreciated.
Starting in iOS 26.4, PushKit has introduced a new "didReceiveIncomingVoIPPushWithPayload" delegate, making it explicit whether or not an app is required to report a call for any given push. The new delegate passes in a PKVoIPPushMetadata object which includes a "mustReport" property.
We have not documented the exact criteria that will cause a mustReport to return false, but those criteria currently include:
The app being in the foreground at the point the push is received.
The app being on an active call at the point the push is received.
The system determines that delivery delays have made the call old enough that it may no longer be viable.
When mustReport is false, apps should call the PushKit completion handler (as they previously have) but are otherwise not required to take any other action.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware
Hi, we are setting up Apple Pay on our website which sells only digital goods. We don't collect a shipping address because we aren't shipping anything. We want to use the user's billing address in order to show them the total amount (including sales tax) before they authorize the purchase. However, it seems that the billing address isn't always provided by Apple Pay before the payment is authorized.
With Apple Pay, what is the recommended way of acquiring the user's billing address before they authorize the purchase?
--
More details about our setup:
We are using the Apple Pay JS API.
In createPaymentRequest, we specify requiredBillingContactFields: ['postalAddress'], but per the docs, the address is provided after the user authorizes the transaction. That is too late for us because we want to show the sales tax before the user authorizes the purchase.
We have attempted to work around this by getting the billing contact details in session.onpaymentmethodselected. For example:
session.onpaymentmethodselected = function (event) {
const billingContact = event.paymentMethod.billingContact;
// Sometimes `billingContact` exists, but other times it does not
}
This doc states:
Before the user authorizes the transaction, you receive redacted billing contact information in a callback event. The redacted information includes only the necessary data for completing transaction tasks, such as calculating taxes or shipping costs.
But in practice, we've observed that sometimes no billing contact information is provided. When a user switches from one card to another, we seem to never get the billing contact associated with the newly selected card.
Is there something we're missing?
The scenario is, in a macOS app (primarly), main thread needs to wait for some time for a certain 'event'. When that event occurs, the main thread is signaled, it gets unblocked and moves on.
An example is, during shutdown, a special thread known as shutdown thread waits for all other worker threads to return (thread join operation). When all threads have returned, the shutdown thread signals the main thread, which was waiting on a timer, to continue with the shutdown flow. If shutdown thread signals the main thread before the later's timer expires, it means all threads have returned. If main thread's timer expires first, it means some threads have failed to join (probably stuck in infinite loop due to bug, disk I/O etc.).
This post is to understand how main thread can wait for some time for the shutdown thread. There are two ways: a) dispatch_semaphore_t b) pthread conditional variable (pthread_cond_t) and mutex (pthread_mutex_t).
Expanding a bit on option (b) using conditional variable and mutex:
// This method is invoked on the main thread
bool ConditionSignal::TimedWait() noexcept
{
struct timespec ts;
pthread_mutex_t * mutex = (pthread_mutex_t *) (&vPosix.vMutexStorage[0]);
pthread_cond_t * cond = (pthread_cond_t *) (&vPosix.vCondVarStorage[0]);
// Set the timer to 3 sec.
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_sec += 3;
pthread_mutex_lock(mutex);
LOG("Main thread has acquired the mutex and is waiting!");
int wait_result = pthread_cond_timedwait(cond, mutex, &ts);
switch (wait_result) {
case 0:
LOG("Main thread signaled!");
return true;
case ETIMEDOUT:
LOG("Main thread's timer expired!");
return false;
default:
LOG("Error: Unexpected return value from pthread_cond_timedwait: " + std::to_string(wait_result));
break;
}
return false;
}
// This method is invoked on shutdown thread after all worker threads have returned.
void ConditionSignal::Raise() noexcept
{
pthread_mutex_t * mutex = (pthread_mutex_t *) (&vPosix.vMutexStorage);
pthread_cond_t * cond = (pthread_cond_t *) (&vPosix.vCondVarStorage);
pthread_mutex_lock(mutex);
LOG("[Shutdown thread]: Signalling main thread...");
pthread_cond_signal(cond);
pthread_mutex_unlock(mutex);
}
Both options allow the main thread to wait for some time (for shutdown thread) and continue execution. However, when using dispatch_semaphore_t, I get the following warning:
Thread Performance Checker: Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions
Whereas, with conditional variables, there are no warnings. I understand the warning - holding the main thread can prevent it from responding to user events, thus causing the app to freeze. And in iOS, the process is killed if main thread takes more than 5 secs to return from applicationWillTerminate(_:) delegate method. But in this scenario, the main thread is on a timed-wait, for some milliseconds i.e., it is guaranteed to not get blocked indefinitely.
While this is described for macOS, this functionality is required for all Apple OSes. What is the recommend way?
Hi everyone,
On macOS 26.4 beta (with Xcode 26.4 beta), I’m seeing the following console messages in a brand new SwiftData + CloudKit template project (no custom logic added, fresh CloudKit container):
updateTaskRequest called for a pre-running task com.apple.coredata.cloudkit.activity.export.F9EE783D-7521-4EC2-B42C-9FD1F29BA5C4
updateTaskRequest called for an already running/updated task com.apple.coredata.cloudkit.activity.export.F9EE783D-7521-4EC2-B42C-9FD1F29BA5C4
Error updating background task request: Error Domain=BGSystemTaskSchedulerErrorDomain Code=8 "(null)"
These messages appear:
When CloudKit is enabled
Occasionally on app launch
Often when bringing the app back to the foreground (Cmd-Tab away and back)
Even with zero additional SwiftData logic
They do not appear when CloudKit is disabled.
This behavior is reproducible on a completely new project with a fresh CloudKit container.
Questions:
What exactly do these messages indicate?
Is BGSystemTaskScheduler Code=8 expected in this context?
Are these safe to ignore?
Is this a known change in logging behavior in macOS 26.4 beta?
Additionally, in a larger project I’ve observed SwiftData crashes and initially suspected these logs might be related. However, since the issue reproduces in a fresh template project, I’m unsure whether this is simply verbose beta logging or something more serious.
Any clarification would be appreciated.
Filed as FB21993521.