Posts under App & System Services topic

Post

Replies

Boosts

Views

Created

WCSessionDelegate not being called in the Apple Wallet Extension With UI
Hi, we are implementing the push provisioning via the Apple Wallet Extension starting from the example at https://developer.apple.com/documentation/passkit/implementing-wallet-extensions. To correctly manage the push provisioning on Apple Watch, specifically for a card tokenised in the iPhone but not in the Watch, we need to know if there is a connected Apple Watch to the iPhone. We are using the following code from the Apple Wallet Extension example to detect whether there is a connected watch: WCSession* session = [WCSession defaultSession]; session.delegate = delegate; [session activateSession]; In the main target of the app, at the end of the activation the system correctly calls the delegate method: session:activationDidCompleteWithState:error: but we noticed it is not being called in the UI extension context (the one having NSExtensionPointIdentifier: com.apple.PassKit.issuer-provisioning.authorization). We don't understand why the delegate is not being called in the UI extension, can you please help? Thanks! Steps to Reproduce: Start with a card not added in the Apple Wallet app Open the Apple Wallet app Click on add card Select the app to launch the Wallet Extension flow The Apple Wallet Extension with UI is on screen and invokes the activateSession method, the delegate method is not invoked and session.isPaired returns "no". Xcode Version 16.2 macOS Version 15.6.1 (24G90) Feedback ID FB20082564
1
0
21
5d
Live Activity life cycle
A Live Activity relies on its app being in the background , but contrary to a widget it does not have a timeline. Our app "in the making" is sandboxed and does not need to receive ActivityKit push notifications How is the app "maintained in life" and not entirely killed for the duration of the activity - Apple documentation says up to 8 hours ? Is it necessary for us to do something to maintain it, like to trick the system , play a white noise audio background ...?
0
0
30
5d
Country from MKReverseGeocoding
As GeoCoder is now deprecated I am struggling to get the country only information from the new MKReverseGeocoding. Maybe someone can guide me or give me direction? Or is this just not possible anymore? let request = MKReverseGeocodingRequest(location: self.lastLocation ?? fallbackLocation) request?.getMapItems { items, error in guard let items = items else { return } self.cityName = items.first?.addressRepresentations?.cityWithContext ?? "" self.countryName = items.first?.addressRepresentations?.regionName ?? "" } I couldn't find anything here, sure you can get the full Address but I need single values to store so the user can search for (example City, Country) In case the structure is always the same, let us say the country is always third part, sure I could split the string but it is not a reliable way to do this, at least for me. Any help would be much appreciated.
1
0
70
5d
Missing INITIAL_BUY notification for a single user (App Store Server Notification V2)
Hi all, We’re implementing in-app subscriptions in our iOS app using App Store Server Notifications V2 in the production environment. Everything is generally working well — we receive notifications such as DID_CHANGE_RENEWAL_STATUS, CANCELLATION, etc., and we log all incoming notifications into our own database. However, we've encountered a single case where the INITIAL_BUY notification was not received for a specific user. Interestingly, we did receive the later notifications (DID_CHANGE_RENEWAL_STATUS and CANCELLATION) for that same user. Here is our setup: App Store Server Notifications V2 Notification endpoint is stable and functioning normally (receives and logs other notifications) Notifications are reliably stored in our database The issue occurred only once for one user Environment: Production We've already contacted Apple Developer Support, but were informed that this issue is out of scope for direct support, and were directed to the Developer Forums. Our questions: Under what conditions might the INITIAL_BUY notification fail to be sent or delivered? Is there any known behavior or scenario where Apple may skip the INITIAL_BUY notification? Any recommendations on how to further investigate or verify whether it was sent from Apple’s side? We’ve confirmed that the notification never hit our server (no logs, no DB record), and our system was healthy at the time. Any insight would be greatly appreciated. Thank you!
2
0
50
5d
Does accessing ARP table via sysctl trigger Local Network Access prompt?
Starting with macOS 15 (Sequoia), applications that perform network discovery operations now trigger a permission prompt: "Allow [AppName] to find devices on local networks". I am using sysctl() with NET_RT_FLAGS and RTF_LLINFO to access the ARP table and retrieve gateway MAC addresses: int mib[6]; mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = AF_INET; mib[4] = NET_RT_FLAGS; mib[5] = RTF_LLINFO; // This flag accesses ARP table entries if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) return nil; From my testing, the Local Network Access prompt does not always appear. It looks like if the MAC address is already cached in the ARP table, no prompt is shown, and the prompt only appears when the system needs to resolve a new MAC address. Is this correct behavior? Does ARP resolution by itself triggering the prompt?
1
0
113
5d
Receipt and Notification behavior after "Remove from Sale"
What is the expected behavior for App Receipts and ASSN v2 notifications when a subscription is set to "Remove from Sale"? I tried to test this in Sandbox, but the "Remove from Sale" setting in App Store Connect doesn't seem to affect the Sandbox environment. For existing subscribers, what happens in the receipt? Does auto_renew_status change to 0 and is expiration_intent populated immediately? Also, which notificationType is sent via ASSN v2?
0
0
32
5d
How to test "Remove from Sale" for subscriptions in Sandbox?
I want to test the "Remove from Sale" scenario in Sandbox. I set my subscription to "Remove from Sale" for all territories in App Store Connect, but I can still make new purchases and auto-renewals continue in the Sandbox environment. Is this a known limitation? Or is there a specific way to make this work for testing? If it can't be tested, I'd like to know the expected production behavior. What changes occur in the App Receipt and what App Store Server Notification is sent?
0
0
13
5d
Error when validating the APNS Certificate
I trying to validate the certificate I created for APNS using the following command but I get an error. openssl s_client -connect gateway.push.apple.com:2195 -cert temp.pem -debug -showcerts Error: getaddrinfo: nodename nor servname provided, or not known connect:errno=0 Any help will be greatly appreciated.
1
0
147
6d
StoreKit returns restored for SKUs marked Consumable (no purchase sheet); Flutter in_app_purchase + SK2
What platform are you targeting? And what version? iOS, testing in Sandbox on a physical device. What version of Xcode are you using? [Xcode __] What version of the OS are you testing on? iOS 18 on iPhone 15 pro. What specific API are you using? StoreKit 2 via Flutter’s in_app_purchase plugin (Dart), which uses in_app_purchase_storekit under the hood. What are the exact steps you took? In App Store Connect, I created several Consumable IAPs (status “Ready to Submit”). Example product IDs: USD3.99TenMinuteCoffeePlan (Consumable) USD24.99OneHourDinnerPlan (Consumable) USD14.99InviteAFriendAsGenie (Consumable) Signed in as a Sandbox tester on device (Settings → App Store → Sandbox Account). App queries products with InAppPurchase.instance.queryProductDetails(ids) — products load successfully. Call buyConsumable(purchaseParam: PurchaseParam(productDetails: ...)). Listen to purchaseStream and log PurchaseDetails. If something failed, what are the symptoms? The purchase sheet often does not appear. The purchase stream reports PurchaseStatus.restored, immediately, for SKUs that are marked Consumable. Example log lines (from Dart): Products loaded: 6 Product: id=USD3.99TenMinuteCoffeePlan, price=3.99 Product: id=USD24.99OneHourDinnerPlan, price=24.99 Product: id=USD14.99InviteAFriendAsGenie, price=14.99 Purchase update: productID=USD3.99TenMinuteCoffeePlan, status=PurchaseStatus.restored, pendingComplete=false, purchaseID=2000000991974131 Purchase update: productID=USD24.99OneHourDinnerPlan, status=PurchaseStatus.restored, pendingComplete=false, purchaseID=2000000992079251 Purchase update: productID=USD14.99InviteAFriendAsGenie, status=PurchaseStatus.restored, pendingComplete=false, purchaseID=2000000999910991 Purchase update: productID=USD29.99InviteAFriendAsGenie, status=PurchaseStatus.restored, pendingComplete=false, purchaseID=2000001003571920 If nothing failed, what results did you see? And what were you expecting? Actual: restored events (no sheet) for items configured as Consumable. Expected: For Consumables, a purchase sheet followed by purchased status. Consumables shouldn’t “restore”. What else have you tried? Verified every SKU shows Type = Consumable and Ready to Submit in App Store Connect; “Cleared for Sale” enabled; pricing/localization filled. Created new product IDs (to avoid any prior non-consumable history). Verified I’m not calling restorePurchases. In the listener, I only grant benefits on PurchaseStatus.purchased (not on restored). Observed that queryProductDetails succeeds; some IDs that aren’t fully configured return “not found,” as expected. Minimal code (core bits): final _iap = InAppPurchase.instance; Future<void> init() async { final resp = await _iap.queryProductDetails({ 'USD3.99TenMinuteCoffeePlan', 'USD24.99OneHourDinnerPlan', 'USD14.99InviteAFriendAsGenie', 'USD29.99InviteAFriendAsGenie', }); _products = resp.productDetails; _sub = _iap.purchaseStream.listen(_onUpdates); } Future<void> buy(ProductDetails p) async { final param = PurchaseParam(productDetails: p); await _iap.buyConsumable(purchaseParam: param); // iOS SK2 path } void _onUpdates(List<PurchaseDetails> list) async { for (final pd in list) { print('status=${pd.status}, id=${pd.productID}, pending=${pd.pendingCompletePurchase}, purchaseID=${pd.purchaseID}'); switch (pd.status) { case PurchaseStatus.purchased: // deliver & (if pendingCompletePurchase) completePurchase break; case PurchaseStatus.restored: // for consumables, I do not deliver here break; default: break; } } } Questions for the community/Apple: Under what conditions would StoreKit 2 return restored for a SKU that’s set to Consumable? Is there any server-side caching of old product type or ownership tied to a product ID that could cause this in Sandbox? Is “Ready to Submit” sufficient for Sandbox testing of IAPs, or must the SKUs be attached to a submitted build before StoreKit treats them as consumable? If a product ID was ever created/purchased as Non-Consumable historically, does creating a new ASC entry with the same string ID as Consumable still cause restored for that tester? Besides creating brand-new product IDs and/or resetting the Sandbox tester’s purchase history, is there any other recommended way to clear this state? Happy to provide a device sysdiagnose or a stripped test project if that helps. Thanks!
0
0
122
6d
SMAppService Sample Code seems broken
I abandoned Mac development back around 10.4 when I departed Apple and am playing catch-up, trying to figure out how to register a privileged helper tool that can execute commands as root in the new world order. I am developing on 13.1 and since some of these APIs debuted in 13, I'm wondering if that's ultimately the root of my problem. Starting off with the example code provided here: https://developer.apple.com/documentation/servicemanagement/updating-your-app-package-installer-to-use-the-new-service-management-api Following all build/run instructions in the README to the letter, I've not been successful in getting any part of it to work as documented. When I invoke the register command the test app briefly appears in System Settings for me to enable, but once I slide the switch over, it disappears. Subsequent attempts to invoke the register command are met only with the error message: `Unable to register Error Domain=SMAppServiceErrorDomain Code=1 "Operation not permitted" UserInfo={NSLocalizedFailureReason=Operation not permitted} The app does not re-appear in System Settings on these subsequent invocations. When I invoke the status command the result mysteriously equates to SMAppService.Status.notFound. The plist is in the right place with the right name and it is using the BundleProgram key exactly as supplied in the sample code project. The executable is also in the right place at Contents/Resources/SampleLaunchAgent relative to the app root. The error messaging here is extremely disappointing and I'm not seeing any way for me to dig any further without access to the underlying Objective-C (which the Swift header docs reference almost exclusively, making it fairly clear that this was a... Swift... Port... [Pun intended]).
8
0
123
6d
Expected behavior for a Notification Service Extension with notification filtering when requestAuthorization has not been requested
If there is a Notification Service Extension which has the com.apple.developer.usernotifications.filtering entitlement, then does/how having that entitlement affect the preconditions for the NSE to be delivered a push? Specifically, if the app has not prompted for requestAuthorization() is it expected that the push will be delivered to the NSE or not? Thank you
1
0
93
6d
How to install macOS Tahoe 26 on an external drive
In the past I was always able to install every major macOS version on an external drive so that I can test my apps. But now I'm unable to install macOS Tahoe 26 on an external drive. Actually, as far as I'm aware, there are not even official links to macOS 26 installers, but only instructions on how to update to macOS 26 from an existing macOS installation. So I thought I'd install macOS 15 on a separate drive and then update to macOS 26, but whenever I run the macOS 15 installer, tell it to install on the external drive, and reboot after the setup process completes, my MacBook just boots into my main macOS partition as if nothing happened. 3 months ago I somehow managed to install macOS Tahoe beta 1 on an external drive, I don't remember how (but I don't think it was anything crazy); booting into that beta 1 partition and trying to update doesn't work either, as my MacBook again boots into my main macOS partition. I already asked help about the update problem one month ago here, but nobody replied. Could someone at Apple please provide instructions on how one is supposed to install macOS 26 on an external drive (if possible before it becomes available to the public)? Are we supposed to buy a separate Mac for every macOS version that we want to test our apps on?
0
1
98
6d
Old HealthKit samples from WatchOS getting deleted and recreated years later
I have recently come across a couple of odd HealthKit step samples from WatchOS. They represent step data measured in 2022 by my Apple Watch, but they have a creation date ("Date Added to Health") within the past couple of days. These odd samples show a "View All Quantities" button at the bottom of the sample Details page in the Health app on iOS 26 (which I've never seen before); the button leads to a list of many small step quantities, almost as if some older, smaller samples were consolidated into these newer samples. Even weirder is that at least some of these samples seem to be getting re-created repeatedly. For example, I've seen the same sample with a "Date Added to Health" of 9/5/25, then 9/8/25, twice on 9/9/25, and twice on 9/10/25. These samples were originally created by WatchOS 9, and are not being deleted/recreated by any apps on my device. I have only observed it since I updated to the iOS 26 beta (and now the RC); my watch was still running iOS 18 the first time it happened, but it has also happened since my watch was updated to WatchOS 26 beta. I did some debug printing of the odd samples and the normal samples surrounding them for comparison. Here's a normal sample: Sample: 80AC5AC5-CBD7-4581-B275-0C2ACA35B7B4 6 count 80AC5AC5-CBD7-4581-B275-0C2ACA35B7B4, (9.0), "Watch6,1" (9.0) "Apple Watch" (2022-09-15 16:20:14 -0500 - 2022-09-15 16:20:16 -0500) Device: <<HKDevice: 0x10591eee0>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:Watch6,1, operatingSystemVersion:9.0> Source: <HKSource:0x110588690 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2022-09-15 21:20:16 +0000 Days between end and add: 0 And here's one of the odd samples: Sample: 4982487F-1189-4F16-AB00-61E37818A66D 676 count 4982487F-1189-4F16-AB00-61E37818A66D, (9.0), "iPhone12,1" (16.2) "Apple Watch" metadata: { HKMetadataKeySyncIdentifier = "6:38082859-D9C8-466A-8882-53443B2A2D94:684969619.25569:684970205.31182:119"; HKMetadataKeySyncVersion = 1; } (2022-09-15 16:20:19 -0500 - 2022-09-15 16:30:05 -0500) Device: <<HKDevice: 0x10591ce40>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:iPhone12,1, operatingSystemVersion:16.2> Source: <HKSource:0x110588640 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2025-09-08 21:11:12 +0000 Days between end and add: 1088 Here's that same odd sample a day later, apparently recreated: Sample: 9E8B12FC-048D-4ECD-BE5B-D387AADE5130 676 count 9E8B12FC-048D-4ECD-BE5B-D387AADE5130, (9.0), "iPhone12,1" (16.2) "Apple Watch" metadata: { HKMetadataKeySyncIdentifier = "6:38082859-D9C8-466A-8882-53443B2A2D94:684969619.25569:684970205.31182:119"; HKMetadataKeySyncVersion = 1; } (2022-09-15 16:20:19 -0500 - 2022-09-15 16:30:05 -0500) Device: <<HKDevice: 0x12f01c4e0>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:iPhone12,1, operatingSystemVersion:16.2> Source: <HKSource:0x12f0f8230 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2025-09-09 20:53:18 +0000 Days between end and add: 1089 It's worth pointing out some differences between the "normal" and "odd" samples (besides the "View All Quantities" button in the Health app). The recreated "odd" samples have a different Source Revision - the "productType" and "operatingSystemVersion" refer to my iPhone, not the Apple Watch device that actually captured the samples. The odd samples also have metadata keys that don't exist in the other samples - HKMetadataKeySyncIdentifier and HKMetadataKeySyncVersion. Questions I'm hoping someone can help with: What are these samples? Why/how do they have a "View All Quantities" button that shows sub-samples? Is this new to iOS 26? Why are some of the samples getting recreated multiple times?
2
0
84
6d
Can my users get siri to use my app without specifying the app name?
I have a food logging app. I want my users to be able to say something like: "Hey siri, log chicken and rice for lunch" But appshortcuts provider is forcing me to add the name of the app to the phrase so it becomes: "Hey siri, log chicken and rice for lunch in FoodLogApp". After running a quick survey, I've found that many users dislike having to say the name of the app, it makes it too cumbersome. My question is: Is there a plan from apple 2026 so the users can converse with Siri and apps more naturally without having to say the name of the app? If so, is it already in Beta and can you point me towards it? @available(iOS 17.0, *) struct LogMealIntent: AppIntent { static var title: LocalizedStringResource = "Log Meal" static var description: LocalizedStringResource = "Log a meal" func perform() async throws -> some IntentResult { return .result() } } @available(iOS 17.0, *) struct LogMealShortcutsProvider: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: LogMealIntent(), phrases: [ "Log chicken and rice for lunch in \(.applicationName)", ], shortTitle: "Log meal", systemImageName: "mic.fill" ) } }
1
0
27
6d
[iOS 26 beta 9] App is moving to Background when user rejected the GSM cellular call.
We have an application WAVE PTT(Push to talk) and Application is in foreground state, When a user receives a cellular call and it is in the "ringing" state and application receives a VoIP APNS(video call) which is reported to CallKit. User rejects the Cellular call from CallKit UI, application Video call is also getting rejected (separate feedback - 19017978) and Here the issue is observed that an Application moved to background(OS26 beta 9). Issue is not observed in iOS 18 and older versions. Frequency : 1 out of 3. Please refer the sysdiagnose logs in below reported feedback ID. Feedback Ticket ID: 20187309 Syslogs Snippet reference: default 2025-09-10 12:30:06.991950 +0530 WAVE PTX 0x10e078100 - ApplicationStateTracker: UISceneDidEnterBackground
1
0
60
6d
SSL certificate failure
This problem doesn’t appear to relate to the app as everything worked when using http (although an https setup issue may still be the problem). The problem appears to relate to the SSL server certificate on the Ubuntu server and the fact that apple does not accept that it is secure. However I have no problem with the equivalent Android app or web browser connections to the same rest API web services. There are numerous posts on these problems on Apple and other Forums, but none have helped me successfully address the issue. I ran an SSL server test on https://www.ssllabs.com/ssltest/ which gives ratings for SSL sites. The test gave an A rating although a number of minor issues were shown that may be crucial to the iOS failure. Some Sectigo certificates said self signed, which I couldn't understand. Error message from XCode log attached 2025-09-10 10:28:01.725091+0100 locateandclock[2291:1585213] ATS failed system trust 2025-09-10 10:28:01.725192+0100 locateandclock[2291:1585213] Connection 1: system TLS Trust evaluation failed(-9802) 2025-09-10 10:28:01.725291+0100 locateandclock[2291:1585213] Connection 1: TLS Trust encountered error 3:-9802 2025-09-10 10:28:01.725352+0100 locateandclock[2291:1585213] Connection 1: encountered error(3:-9802) 2025-09-10 10:28:01.726727+0100 locateandclock[2291:1585213] Task <4E41098F-6B71-4FB8-8753-78DD32961812>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9802]) 2025-09-10 10:28:01.736504+0100 locateandclock[2291:1585213] Task <4E41098F-6B71-4FB8-8753-78DD32961812>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=( "<cert(0x10681be00) s: *.xxxxxxxxxxx.co.uk i: Sectigo Public Server Authentication CA DV R36>", "<cert(0x10681c800) s: Sectigo Public Server Authentication CA DV R36 i: Sectigo Public Server Authentication Root R46>", "<cert(0x10681d200) s: Sectigo Public Server Authentication Root R46 i: Sectigo Public Server Authentication Root R46>" ), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://xxxxxxxxxxxx.co.uk/insertclocking, NSErrorFailingURLStringKey=https://xxxxxxxxxxxx.co.uk/insertclocking, NSUnderlyingError=0x282361650 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x281cf4460>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=( "<cert(0x10681be00) s: *.xxxxxxxxxxxxxco.uk i: Sectigo Public Server Authentication CA DV R36>", "<cert(0x10681c800) s: Sectigo Public Server Authentication CA DV R36 i: Sectigo Public Server Authentication Root R46>", "<cert(0x10681d200) s: Sectigo Public Server Authentication Root R46 i: Sectigo Public Server Authentication Root R46>" )}}, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <4E41098F-6B71-4FB8-8753-78DD32961812>.<1>" ), _kCFStreamErrorCodeKey=-9802, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <4E41098F-6B71-4FB8-8753-78DD32961812>.<1>, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x281cf4460>, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.}
2
0
86
6d
Selecting ~/Library in open panel doesn't give access to ~/Library/Mail
A user of my app brought to my attention that unless they select their ~/Library/Mail folder explicitly in an open panel, they get an error when scanning it inside my app. I can confirm that I also get a permission error when trying to scan it as a subfolder of ~/Library, but not if I select it directly. I'm assuming this is intentional, but it would be nice to have an explanation or some documentation that I can point my users to when they encounter what appears to them as a bug in my app. What makes this matter even more confusing is that selecting a folder in any open panel of an app gives the app access to it for the lifetime of the app, but after restarting the app, access is lost again (unless it has a bookmark to it). This was probably the reason why the user thought that it worked in another app but not in mine. This is the code I use to scan: let openPanel = NSOpenPanel() openPanel.canChooseDirectories = true if openPanel.runModal() == .cancel { return } let enumerator = FileManager.default.enumerator(at: openPanel.urls[0], includingPropertiesForKeys: nil) { url, error in print(url.path, error) return true } while let url = enumerator?.nextObject() as? URL { } And this the error related to the Mail folder: ~/Library/Mail Error Domain=NSCocoaErrorDomain Code=257 "The file “Mail” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///~/Library/Mail, NSFilePath=/~/Library/Mail, NSUnderlyingError=0x600002991470 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
4
0
84
6d