Hello,
I have 3 model versions and I'm trying to step through migration.
Version 2 makes significant changes to v1. As a result, I've renamed the entities in question by appending _v2 to their name, as the data isn't important to retain.
v3, remove's the appended version number from v2.
Setting the .xcdatamodeld to v3 and the migrations steps array as follows causes the app to error
[
NSLightweightMigrationStage([v1]),
NSLightweightMigrationStage([v2]),
NSLightweightMigrationStage([v3]),
]
CoreData: error: <NSPersistentStoreCoordinator: 0x10740d680>: Attempting recovery from error encountered during addPersistentStore: 0x10770f8a0 Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration."
An error occurred during persistent store migration. Cannot merge multiple root entity source tables into one destination entity root table.
I find this odd because if I run the migration independently across app launches, the migration appears to drop the no longer used tables in v2, then re-add them back in v3. So it seems to me that something is not finishing completely with the fully stepped through migration.
--
I'm also unable to understand how to use NSCustomMigrationStage I've tried setting it to migrate from v1, to v2, but I'm getting a crash with error
Duplicate version checksums across stages detected
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
our app has a helper to perform privileged operations which communicates with the main app via xpc_connection*
previously that helper was installed via SMJobBless() into the /Library/LaunchDaemons/ and /Library/PrivilegedHelperTools/
due to various issues with the old SMJobBless() as well as it being deprecated we have ported the helper to the new SMAppService API where the helpers do not need to be installed but remain within the app bundle ( [[SMAppService daemonServiceWithPlistName:HELPER_PLIST_NAME] registerAndReturnError:&err] )
the new approach has been used in production for a year now and works fine in most cases and seems to be more reliable than the old SMJobBless().
however, we've observed two problems with the new helper architecture.
• sometimes when users update the app (with the built-in Sparkle framework), the app does not seem to have FullDiskAccess, although the checkbox in the system settings remains toggled on. only once the Mac has been restarted, things work fine again. since this is cured by a reboot, lets ignore this issue
• on some Macs, it just seems impossible to use the helper, while "installation" via SMAppService runs fine without error, using the helper always just fails with Connection invalid. This issue seems to affect ~0.2% of our users Macs, and we have found no cure yet how to get things into a working state on those Macs. luckily the issue also occurs 100% reproducible on one of the Macs in our office now. the problem seems to be a regression in macOS 26, as things worked absolutely fine on all previous macOS versions.
we'd like to investigate why the helper just won't work on some Macs. unfortunately even enabling Console logging for just a few seconds yields thousands of messages nowadays, but this may be insightful:
we found that on the "bad Mac", the "FATAL ERROR - fullPath is nil" always appears and subsequently no working XPC connection to the helper is ever established.
on the "good Macs", this "fullPath is nil" error never appears, and the XPC connection works fine after all the required permissions (helper permission, FDA permission) are granted.
so, my questons:
• has anyone else seen a problem where a SMAppService / XPC based priviledged helper just won't work on a handful of Macs?
• what about the "FATAL ERROR - fullPath is nil", is this the real root cause of the issue or should we look somewhere else? how can we prevent the issue on the affected Macs?
the only thing that seems to be clear here is that this is a macOS 26 Tahoe bug.
macOS Tahoe 26: DFS namespace subfolders return "No route to host" while direct SMB connections work
Environment
macOS Tahoe 26.2 (Build 25C56)
Also tested with macOS 26.3 Developer Beta - same issue
Windows Server 2022 DFS namespace
Connection via Tailscale VPN (but also tested with direct network connection)
Problem Description
When connecting to a Windows Server 2022 DFS namespace from macOS Tahoe, the root namespace connects successfully, but all subfolders appear empty and return either:
"No route to host"
"Authentication error" (alternates inconsistently)
Steps to Reproduce
Set up a Windows Server 2022 DFS namespace (e.g., \\domain.com\fs)
Add DFS folder targets pointing to file servers (e.g., \\fs02\share, \\fs03\share)
From macOS Tahoe, connect via Finder: smb://domain.com/fs
Root namespace mounts successfully
Issue: Subfolders show as empty or return "No route to host" when accessed
What Works
Direct SMB connections to individual file servers work perfectly:
smb://10.118.0.26/sharename ✓
smb://fs02.domain.com/sharename ✓
Same DFS namespace works from Windows clients
Same DFS namespace worked from macOS Sonoma 14.4+
What Doesn't Work
DFS referrals from macOS Tahoe 26.x to any DFS folder target
The issue persists regardless of:
Kerberos vs NTLM authentication
SMB signing enabled/disabled on servers
Various /etc/nsmb.conf configurations
DNS resolution (tested with IPs and FQDNs)
Historical Context
A similar DFS referral bug existed in macOS Sonoma 14.0 and was fixed in 14.1. This appears to be a regression in macOS Tahoe 26.
Request
Please investigate the DFS referral handling in macOS Tahoe. The fact that direct SMB connections work while DFS referrals fail suggests an issue specifically in the DFS referral processing code.
Feedback Assistant report will be filed separately.
I understand that private APIs are not permitted under Apple’s App Review Guidelines. However, our application requires I²C communication, and we are currently using the following APIs: IOAVServiceReadI2C IOAVServiceWriteI2C IOI2CSendRequest.These api's are not permitted by apple.
I didnt found any alternative public api to achieve I²C communication.
please suggest any public api's for the same or any chance to use this private api.
Why is the WiFiAware framework not importable in Mac Catalyst? Are there any plans to support Wi-Fi Aware technology on Mac Catalyst in the future?
I'm setting up App Entities for my SwiftData models and I'm not sure about the best way to reference SwiftData model properties in the AppEntity.
I have a SwiftData model with many properties:
@Model
final class Contact {
@Attribute(.unique) var id: UUID = UUID()
var name: String
var phoneNumber: String
var email: String
var website: URL?
var birthday: Date?
var notes: String
// ... many more properties
}
I want to expose these properties on my AppEntity so they're available for system features, such as giving Apple Intelligence more context about on-screen content.
struct ContactEntity: AppEntity {
var id: UUID
@Property(title: "Name")
var name: String
@Property(title: "Phone")
var phoneNumber: String
@Property(title: "Email")
var email: String
// ... all the other properties
}
I couldn't find guidance in the documentation for this specific situation. I've considered two approaches:
Add @Property variables to the AppEntity for each SwiftData model property and copy all values from the SwiftData model to the AppEntity in the AppEntity initializer — but I recall this being discouraged in previous WWDC sessions since it duplicates data and can become stale
Use @ComputedProperty to fetch the model and access the single properties — this seems like an alternative, but fetching the entire model just to access individual properties doesn't feel right
What is the recommended approach when SwiftData is the data source?
Thank you!
Hi all,
I have setup my app to use SwiftData with CloudKit sync. I have a production environment and development environment. I can reset the development environment for myself and all users in CloudKit console, but I can't reset the production one as it's tried to users' iCloud accounts, so I've added a button in-app for that feature. In the onboarding of my app, I pre-seed the DB with some default objects, which should be persisted between app install. The issue I'm running into is that I'm unable to force-pull these models from iCloud during the onboarding of a clean re-install, which leads to the models later appearing as duplicates once the user has been on the app for a few minutes and it has pulled from their iCloud account. If anyone has any suggestions on how to handle this issue, I would greatly appreciate it.
Hello everyone,
I am developing an iOS application that relies on accelerometer data for precise motion and reaction-time measurements.
Based on practical testing, it appears that third-party iOS applications receive accelerometer data at a maximum rate of approximately 100 Hz, regardless of hardware capabilities or requested update intervals.
I would like to ask for clarification on the following points:
Is there an officially supported way for third-party iOS apps to access accelerometer data at sampling rates higher than ~100 Hz?
If the hardware supports higher sampling rates, is this limitation intentionally enforced at the iOS level for third-party applications?
Are there any public APIs, entitlements, or documented approaches that allow access to higher-frequency sensor data, or is this restricted to system/internal components only?
Thank you in advance for any clarification.
Topic:
App & System Services
SubTopic:
Hardware
I am getting this error when I try to show device activity report view by this DeviceActivityReport(appsContext, filter: filter)
Attempt to map database failed: permission was denied. This attempt will not be retried.
I have taken access by this way. AuthorizationCenter.shared.requestAuthorization(for: .individual)
Detailed errors:
LaunchServices: store (null) or url (null) 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.
I am getting this error when I try to show device activity report view by this DeviceActivityReport(appsContext, filter: filter)
Attempt to map database failed: permission was denied. This attempt will not be retried.
I have taken access by this way. AuthorizationCenter.shared.requestAuthorization(for: .individual)
As part of the OpenJDK testing we run several regression tests, including for Java SE networking APIs. These APIs ultimately end up calling BSD socket functions. On macos, starting macos 26, including on recent 26.2 version, we have started seeing some unexplained but consistent exception from one of these BSD socket APIs. We receive a "ENOBUFS" errno (No buffer space available) when trying to construct a socket(). These exact same tests continue to pass on many other older versions of macos (including 15.7.x). After looking into this more, we have been able to narrow this down to a very trivial C code which is as follows (also attached):
#include <stdio.h>
#include <sys/socket.h>
#include <string.h>
#include <unistd.h>
#include <sys/errno.h>
static int create_socket(const int attempt_number) {
const int fd = socket(AF_INET6, SOCK_STREAM, 0);
if (fd < 0) {
fprintf(stderr, "socket creation failed on attempt %d,"
" due to: %s\n", attempt_number, strerror(errno));
return fd;
}
return fd;
}
int main() {
const unsigned int num_times = 250000;
for (unsigned int i = 1; i <= num_times; i++) {
const int fd = create_socket(i);
if (fd < 0) {
return -1;
}
close(fd);
}
fprintf(stderr, "successfully created and closed %d sockets\n", num_times);
}
The code very trivially creates a socket() and close()s it. It does this repeatedly in a loop for a certain number of iterations.
Compiling this as:
clang sockbufspaceerr.c -o sockbufspaceerr.o
and running it as:
./sockbufspaceerr.o
consistently generates an error as follows on macos 26.x:
socket creation failed on attempt 160995, due to: No buffer space available
The iteration number on which the socket() creation fails varies, but the issue does reproduce. Running the same on older versions of macos doesn't reproduce the issue and the program terminates normally after those many iterations.
Looking at the xnu source that is made available for each macos release here https://opensource.apple.com/releases/, I see that for macos 26.x there have been changes in this kernel code and there appears to be some kind of memory accountability code introduced in this code path. However, looking at the reproducer/application code in question, I believe it uses the right set of functions to both create as well as release the resources, so I can't see why this should cause the above error in macos 26.x.
Does this look like some issue that needs attention in the macos kernel and should I report it through feedback assitant tool?
We tried to fetch the recorded PPG data using SensorKit
with the following code, however the didFetchResult callback method is never called.
let ppgReader = SRSensorReader(sensor: .photoplethysmogram)
let request = SRFetchRequest()
let nowDate = Date()
let toDate = nowDate.addingTimeInterval(-25 * 60 * 60)
let fromDate = toDate.addingTimeInterval(-24 * 60 * 60)
request.from = SRAbsoluteTime.fromCFAbsoluteTime(_cf: fromDate.timeIntervalSinceReferenceDate)
request.to = SRAbsoluteTime.fromCFAbsoluteTime(_cf: toDate.timeIntervalSinceReferenceDate)
ppgReader.delegate = self;
ppgReader.fetch(request)
The delegate called the didComplete successfully:
func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest)
But never called the didFetchResult
func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult<AnyObject>) -> Bool
Any ideas why ? (I am wearing the watch for couple days and ensure it has the data for the time period I am querying)
One thing I notice is when Apple granted us the entitlement, it uses Uppercase for ECG and PPG, however the document use Lowercases in the plist https://developer.apple.com/documentation/sensorkit/srsensor/photoplethysmogram
Dose it matter ?
Apple supports Wi‑Fi Aware, but it’s not clear what channel bandwidth Apple’s Wi‑Fi Aware uses. Is it 80 MHz or 40 MHz? Also, what is the channel bandwidth used by AirDrop?
Hi,
I got family controls (distribution) approved for my main app and assumed this would carry over to my extensions but it did not. Do I need to re-request for other the deviceactivitymonitorextension and deviceactivityreportextension?
Hello,
I have an asset pack that I'm use to periodically distribute a sqlite database thats being used to an NSPersistentStore.
Because the database is over a few GBs, and the files in an AssetPack are not mutable, I have to stream the database into a temporary file, then replace my NSPersistentStore.
This requires that the user has 3x the storage available of the database, and permanently uses twice to storage needed.
I'd like:
To be able to mark a URL/File to be accessible for read/write access
To be able to mark a file / URL as consumed when it's no needed. So that it can be cleared from the user storage while still maintaining an active subscription to the asset pack for updates.
Thank you
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags:
Files and Storage
On demand resources
Core Data
Background Assets
I have an iOS app (1Address) which allows users to share their address with family and friends using CloudKit Sharing.
Users share their address record (CKRecord) via a share link/url which when tapped allows the receiving user to accept the share and have a persistent view into the sharing user's address record (CKShare).
However, most users when they recieve a sharing link do not have the app installed yet, and so when a new receiving user taps the share link, it prompts them to download the app from the app store.
After the new user downloads the app from the app store and opens the app, my understanding is that the system (iOS) will/should then vend to my app the previously tapped cloudKitShareMetadata (or share url), however, this metadata is not being vended by the system. This forces the user to re-tap the share link and leads to some users thinking the app doesn't work or not completing the sharing / onboarding flow.
Is there a workaround or solve for this that doesn't require the user to tap the share link a second time?
In my scene delegate I am implementing:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {...}
And also
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {...}
And also:
func windowScene(_ windowScene: UIWindowScene, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShare.Metadata) {...}
And:
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {...}
Unfortunately, none of these are called or passed metadata on the initial app run after install. Only after the user goes back and taps a link again can they accept the share.
This documentation: https://developer.apple.com/documentation/cloudkit/ckshare says that adding the CKSharingSupported key to your app's Info.plist file allows the system to launch your app when a user taps or clicks a share URL, but it does not clarify what should happen if your app is being installed for the first time.
This seems to imply that the system is holding onto the share metadata and/or url, but for some reason it is not being vended to the app on first run.
Open to any ideas here for how to fix and I also filed feedback: FB20934189.
I’m currently developing an iOS app built in Unity, exported to Xcode for signing and deployment. The app needs to register for Apple Push Notifications (APNs) to retrieve the device token and register it with a backend service (PlayFab).
Despite enabling the required capabilities and entitlements, the app never receives a device token — the authorization request succeeds, but the token remains empty (req.DeviceToken is null in Unity).
I’ve confirmed that the issue occurs before PlayFab or Firebase are involved, meaning the app never receives the token from Apple Push Notification service (APNs) itself.
The Unity script I am using is:
#if UNITY_IOS
using UnityEngine;
using Unity.Notifications.iOS;
using PlayFab;
using PlayFab.ClientModels;
using System.Collections;
using System;
public class iOSPushInit : MonoBehaviour
{
private const int MaxRetries = 5;
private const float RetryDelay = 2f; // seconds
void Start()
{
Debug.Log("🛠 iOSPushInitDebug starting...");
StartCoroutine(RequestAuthorizationAndRegister());
}
private IEnumerator RequestAuthorizationAndRegister()
{
// Request Alert + Badge + Sound permissions and register for remote notifications
var authOptions = AuthorizationOption.Alert | AuthorizationOption.Badge | AuthorizationOption.Sound;
using (var req = new AuthorizationRequest(authOptions, true))
{
Debug.Log("⏳ Waiting for user authorization...");
while (!req.IsFinished)
{
yield return null;
}
Debug.Log($"🔔 Authorization finished at {DateTime.Now}: granted={req.Granted}, error={req.Error}");
if (!req.Granted)
{
Debug.LogError("❌ User denied notification permissions! Cannot get APNs token.");
yield break;
}
// Authorization granted → check for device token
int attempt = 0;
string token = req.DeviceToken;
Debug.Log($"req.DeviceToken: {req.DeviceToken}");
while (string.IsNullOrEmpty(token) && attempt < MaxRetries)
{
attempt++;
Debug.Log($"ℹ️ APNs token not available yet. Attempt {attempt}/{MaxRetries}. Waiting {RetryDelay} seconds...");
yield return new WaitForSeconds(RetryDelay);
token = req.DeviceToken;
}
if (string.IsNullOrEmpty(token))
{
Debug.LogWarning("⚠️ APNs token still null after multiple attempts. Try again on next app launch.");
yield break;
}
Debug.Log($"📱 APNs Token acquired at {DateTime.Now}: {token}");
// Register with PlayFab
var request = new RegisterForIOSPushNotificationRequest
{
DeviceToken = token,
SendPushNotificationConfirmation = false
};
PlayFabClientAPI.RegisterForIOSPushNotification(request,
result => Debug.Log("✅ APNs token successfully registered with PlayFab."),
error => Debug.LogError("❌ Failed to register APNs token with PlayFab: " + error.GenerateErrorReport()));
}
}
}
#endif
When running on a real device (not simulator), the following is logged in Xcode:
🔔 Authorization finished: granted=True, error=
ℹ️ APNs token not yet available. Try again on next app launch.
In the Xcode console, I do not see the expected APNs registration message:
[Device] Registered for remote notifications with token: <...>
Environment Details:
Engine: Unity 6000.2.6f2
Notifications package: com.unity.mobile.notifications 2.4.2
Xcode: 16.4 (16F6)
iOS Device: iPhone 12, iOS 26.0.1
Testing Method: Building directly from Unity → Xcode → real device
Signing mode: Automatic (with correct Team selected)
Certificates in account:
Apple Development certificate (active)
Apple Distribution certificate (active)
Provisioning Profile:
Type: App Store (also tested Development profile)
Enabled Capabilities: Push Notifications, In-App Purchase
App ID Capabilities:
Push Notifications: Enabled
Development SSL certificate: Present
Production SSL certificate: Not generated (yet)
Background Modes -> remote notifications
What I Have Verified:
✅ Push Notifications capability is enabled in the Xcode target (not UnityFramework).
✅ Team and Bundle Identifier match my Apple Developer App ID.
✅ App ID has Push Notifications enabled in the Developer Portal.
✅ Tested on a real iOS device with working internet.
✅ Rebuilt and reinstalled app after enabling Push Notifications.
✅ Authorization dialog appears and permission is granted by user.
How can I resolve this issue?
Topic:
App & System Services
SubTopic:
Notifications
After adding furhter IAP Items to my app, none of the products are available for purchase an more on iOS. But it works just fine on the Mac Catalyst app.
Logging the request shows that all product IAP IDs are "invalid", even those who already were on sale.
Any idea what this can be caused by?
Ive already double checked the obvious things like the product IDs on appstoreconnect, bundle ID, tested on different devices, Test Flight etc...
Has anyone experienced this already?
I have an app that has been using the following code to down load audio files:
if let url = URL(string: episode.fetchPath()) {
var request = URLRequest(url: url)
request.httpMethod = "get"
let task = session.downloadTask(with: request)
And then the following completionHandler code:
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {
try FileManager.default.moveItem(at: location, to: localUrl)
In the spirit of modernization, I'm trying to update this code to use async await:
var request = URLRequest(url: url)
request.httpMethod = "get"
let (data, response) = try await URLSession.shared.data(for: request)
try data.write(to: localUrl, options: [.atomicWrite, .completeFileProtection])
Both these code paths use the same url value. Both return the same Data blobs (they return the same hash value)
Unfortunately the second code path (using await) introduces a problem. When the audio is playing and the iPhone goes to sleep, after 15 seconds, the audio stops. This problem does not occur when running the first code (using the didFinish completion handler)
Same data, stored in the same URL, but using different URLSession calls. I would like to use async/await and not have to experience the audio ending after just 15 seconds of the device screen being asleep. any guidance greatly appreciated.
Topic:
App & System Services
SubTopic:
Networking
Tags:
Files and Storage
Network
CFNetwork
Background Tasks
Hello, I hope the title is self explanatory.
As a system administrator I would like to use macOS server
on Sequoia to manage the protected network behind this server:
bootpd,
natpmpd,
paquet filter,
postfix mail server,
squid proxy…
I am at a lost not to find in less than 15 minutes
where this is available.
Sorry for the silly question.
Topic:
App & System Services
SubTopic:
Networking