Post

Replies

Boosts

Views

Activity

Use IOKit to access usb in MacOS
Hi, I am trying to develop MacOS application which will be connecting to USB devices and should be available in AppStore. So it must be Sandbox and probably I've to use permission com.apple.security.device.usb. I've following requirements: I need to detect USB devices with file system I need to have ability to upload & download files from this device I need to read device serial number I wonder if I can use IOKit for this and it will be compliant with AppStore rules or not?
5
0
100
6d
Difference between Push delivery metrics in APNs console vs. 410 code for unregistered tokens
Hi there, We’re using APNs Push delivery metrics, which provide a breakdown including metrics like Received by APNs, Delivered to Device, and Discarded - Token Unregistered. To track unregistered tokens on our end, we also monitor the 410 error responses from APNs, which typically indicate that a token is no longer valid. However, we’ve noticed a discrepancy: the number of 410 errors we receive is much lower than the Discarded - Token Unregistered count shown in the APNs console. Is this difference expected? Specifically, does APNs sometimes know that a token is unregistered but still return a success status to us when we attempt to send a push to that token? Thank you for any insights you can provide!
1
0
121
6d
M4 devices - VMs pre 13.4 fail to boot
Hi, It seems that on M4 devices any virtual machine with macOS version older than 13.4 fail to boot, they stuck with a black screen. This is regardless of the virtualization software used (UTM, VirtualBuddy, Viable, etc...). After talking to many people everyone experiences the same. At least for me, this is a massive limitation of the platform, I really hope this is a bug which can be fixed. Thanks, Csaba
5
6
369
6d
iOS Action and Share Extensions disappear for users
Several users have reported that my iOS Action and Share Extensions is not visible. Now one of the TestFlight users has reported the same. Notice this user has been using the app for one year, so they know how to use it. Doing FaceTime and them sharing the screen, we have tried: Deleting app and downloading from App Store Deleting app, turning device off (call was off) and turning it on, downloading from App Store Deleting app, turning device off (call was off) and turning it on, downloading from TestFlight They can open the app, they just do not see the extensions. I would have thought it was the activation rules inside of the InfoPlist, but they are the same for all users and my other testers are not facing the issue. Device is iPhone 16 Pro, iOS 18.1 What other steps could I follow? What other information could I gather to fix this?
1
0
62
6d
Apple Pay Domain Registration - Salesforce B2c
Hi everyone. I'm having a problem to register a new domain using the Salesforce Commerce Cloud. Internally, commerce has a plugin that allows me to register my domain with Apple. It works for dev environments. But now, I'm trying to register my production domain, which uses Akamai, and it is returning error 403 when Apple tries to 'verify' my domain. My guess is that Akami is blocking something request from Apple. So, I'd like to know if all requests from Apple to verify my domain use something that allows me to identify these requests, and then, I can create a rule in Akamai to allow this request. I noticed that one of the information sent in Apple request is: User-Agent: oslopartner Client 1.0 Is this agent variable or fixed? If it is fixed, I'll try to use it as parameter to identify the Apple requests on Akamai side. Any other idea will be appreciated. Thanks in advance
0
0
61
6d
NWConnection and "Network is Down" error connecting to ip address and port
I have a pretty straightforward code to connect to a given ip address and port using NWConnection. On the first attempt to connect to the Local Network I see the "Local Network Privacy" dialog and sometimes if I press "Don't Allow" on that dialog everything starts to fail. No matter I do I keep receiving the following error: POSIXErrorCode(rawValue: 50): Network is down Obviously going to settings and allowing local network access to the app doesn't fix the issue. Neither deleting the app and installing it again. The only workaround I found is to restart my device which is unacceptable for a user. My code is really simple, I tried a lot of different approaches to connect but neither approach worked. I am on iOS 18. Is it a known bug? could be possible a bug on my code? Any idea would be really appreciated, thanks!
7
2
162
6d
Siri phrase with multiple dynamic values
My requirement is to open a specific screen of my app with when user says " Start Sleep meditation for 10 minutes" where Sleep and 10 minutes are dynamic values in the phrase. Is it possible just with a phrase we can get the values. Or do i need to ask using siri "which meditation" and then "how much tine". I am planning to use AppIntent and AppShortcut, along with Entities. But unable to open the shortcut when siri invokes with phrase i discussed above.
0
0
83
6d
Questions about CloudKit cross-device synchronization
The same macOS app is logged into the same iCloud account on two Macs. The apps on both devices can sync data with iCloud, but the data between them is isolated. When I was developing, I just enabled the CloudKit(SwiftData host in iCloud) capability and did not do anything special. I thought that the same app and the same iCloud account should sync the same data between different devices. Why is the cloud data on these two Macs isolated?
1
0
96
6d
Missing flows for content filter on macOS 15 Sequoia
We use as content filter in our app to monitor flows, we gather data about the flow and block flows deemed suspicious. Our content filter is activated/deactivated by a UI app but the flows are reported via XPC to a separate daemon process for analysis. As of macOS 15, we are seeing cases where flows are missing or flows are not received at all by the content filter. The behaviour is not consistent, some devices seem to receive flows normally but others don't. It appears Intel devices are much less prone to showing the problem, whereas Arm devices routinely exhibit missing flows. On macOS 14 or earlier, there is no sign of missing flows. Testing on earlier beta versions of macOS 15 did not appear to show the problem, however I can't rule out if issue was present but it wasn't spotted. Experimenting with simple examples of using a content filter (e.g. QNE2FilterMac) does not appear to reproduce the issue. Questions, What has changed between macOS 14 and 15 that could be the cause of the lack of flows? Is our approach to using an app activated content filter reporting to a daemon connected via XPC unsupported?
4
0
131
6d
Kernel Panic after update of macOS
Hi I have some problems with my macOS after updating to Sonoma. I am running a intel based MacBookPro 2018. After update to Sonoma I had some Kernel panic. Log attached. Also I had some problems running my LaunchDaemon for starting macFUSE and connecting to SSHFS. This used to work before. Now, my plan forward is to restore a backup from the MacBook before update. I will restore the backup and remove any redundant/not in use .plist jobs ( especially ) LaunchDaemon jobs. When this is done I will try to update macOS again. I have many .plist jobs also Daemon. Please supply information on how I can remove any redundant / not in use .plist jobs. I belive the reason for the kernel panic was the io.macfuse.filesystems.macfuse.23 4.7.2. ( attached log ) I want to keep the io.macfuse.filesystems.macfuse.23 4.7.2 , but I want to remove other kexts not in use and other .plist not in use. Please supply info in how to identify redundant kexts not in use and redundant .plist not in use. How do I know if the induvidual kexts is needed or not ? Best regards Tormod Willassen Kernel_Panic.rtf log-file log-file
0
0
82
6d
CKSyncEngine and desiredKeys
I have a CKRecord that references an CKAsset. If I understand it correctly, CKSyncEngine would download the asset every time the record has changed on the server. (Of course it would try to use the local asset cache, but worst-case it might be already flushed) The documentation for CKAsset says that asset downloads can be prevented by limiting the requested record keys using the desiredKeys property on the fetch operation. But I don't see any possibility to set this property when using CKSyncEngine. Did I miss something? Are there any alternatives?
2
0
53
6d
Torch Strobe not working in light (ambient light) environments on iOS 18.1
As of iOS 18.1 being released we are having issues with our users experiencing issues with our app that relies on strobing the device torch. We have narrowed this down to being caused on devices with adaptive true-tone flash and have submitted a radar: FB15787160. The issue seems to be caused by ambient light levels. If run in a dark room, the torch strobes exactly as effectively as in previous iOS versions, if run in a light room, or outdoors, or near a window, the strobe will run for ~1s and then the torch will get stuck on for half a second or so (less frequently it gets stuck off) and then it will strobe again for ~1s and this behaviour repeats indefinitely. If we go to a darker environment, and background and then foreground the app (this is required) the issue is resolved, until moving to an area with higher ambient light levels again. We have done a lot of debugging, and also discovered that turning off "Auto-Brightness" from Settings -> Accessibility -> Display & Text Size resolves the issue. We have also viewed logs from Console.app at the time of the issue occurring and it seems to be that there are quite sporadic ambient light level readings at the time at which the issue occurs. The light readings transition from ~100 Lux to ~8000 Lux at the point that the issue starts occurring (seemingly caused by the rear sensor being affected by the torch). With "Auto-Brightness" turned off, it seems these readings stay at lower levels. This is rendering the primary use case of our app essentially useless, would be great to get to the bottom of it! We can't even really detect it in-app as I believe using SensorKit is restricted to research applications and requires a review process with Apple before accessing? Edit: It's worth noting this is also affecting other apps with strobe functionality in the exact same way
1
3
102
6d
Can't get iCloud root directory on iCould Documents
I couldn't get iCloud root directory ("iCloud Drive not available or user domain not found."). Anybody had similar issue? I don't want to CloudKit. Xcode: Version 16.0 I have done below: Settings > iCloud Backup ON Settings > iCloud > iCloud Drive ON Settings > iCloud > MyApp ON import Foundation import UIKit class BackupManager { var isiCloudEnabled: Bool { (FileManager.default.ubiquityIdentityToken != nil) } // Get the iCloud Drive folder and create a folder if needed func createFolder() -> URL? { let fileManager = FileManager.default // Access the iCloud Drive root directory (user-visible folder) guard let iCloudRootURL = fileManager.url(forUbiquityContainerIdentifier: nil)? .appendingPathComponent("Documents") else { print("iCloud Drive not available or user domain not found.") return nil } // Check if the folder exists in iCloud Drive root, if not, create it if !fileManager.fileExists(atPath: iCloudRootURL.path) { do { try fileManager.createDirectory(at: iCloudRootURL, withIntermediateDirectories: true, attributes: nil) print("Folder created in iCloud Drive") } catch { print("Error creating folder: \(error.localizedDescription)") return nil } } // Return the URL of the folder in iCloud Drive return iCloudRootURL } }
1
0
46
6d
Background Tasks runs foreground
Hello everyone! I'm having a problem with background tasks running in the foreground. When a user enters the app, a background task is triggered. I've written some code to check if the app is in the foreground and to prevent the task from running, but it doesn't always work. Sometimes the task runs in the background as expected, but other times it runs in the foreground, as I mentioned earlier. Could it be that I'm doing something wrong? Any suggestions would be appreciated. here is code: class BackgroundTaskService { @Environment(\.scenePhase) var scenePhase static let shared = BackgroundTaskService() private init() {} // MARK: - create task func createCheckTask() { let identifier = TaskIdentifier.check BGTaskScheduler.shared.getPendingTaskRequests { requests in if requests.contains(where: { $0.identifier == identifier.rawValue }) { return } self.createByInterval(identifier: identifier.rawValue, interval: identifier.interval) } } private func createByInterval(identifier: String, interval: TimeInterval) { let request = BGProcessingTaskRequest(identifier: identifier) request.earliestBeginDate = Date(timeIntervalSinceNow: interval) scheduleTask(request: request) } // MARK: submit task private func scheduleTask(request: BGProcessingTaskRequest) { do { try BGTaskScheduler.shared.submit(request) } catch { // some actions with error } } // MARK: background actions func checkTask(task: BGProcessingTask) { let today = Calendar.current.startOfDay(for: Date()) let lastExecutionDate = UserDefaults.standard.object(forKey: "lastCheckExecutionDate") as? Date ?? Date.distantPast let notRunnedToday = !Calendar.current.isDate(today, inSameDayAs: lastExecutionDate) guard notRunnedToday else { task.setTaskCompleted(success: true) createCheckTask() return } if scenePhase == .background { TaskActionStore.shared.getAction(for: task.identifier)?() } task.setTaskCompleted(success: true) UserDefaults.standard.set(today, forKey: "lastCheckExecutionDate") createCheckTask() } } And in AppDelegate: BGTaskScheduler.shared.register(forTaskWithIdentifier: "check", using: nil) { task in guard let task = task as? BGProcessingTask else { return } BackgroundTaskService.shared.checkNodeTask(task: task) } BackgroundTaskService.shared.createCheckTask()
1
0
96
6d
Is having a button to exit the app on iOS still ground to exclusion ?
Hello In the past, the documentation and specifically design guidelines were quite clear about the fact that having an exit button was not a good thing, and programmatically exiting the app was prohibited and ground to rejection by the review team. Looking though the documentation and guidelines nowadays, I cannot find any explicit mention of this. We have a client that want us to add such button on the main menu of an app, and we are looking to hard evidence that this is against standards. Has Apple stance on this changed ? Or have I missed it in the doc somewhere ?
3
0
85
6d
macOS 15.2, strange runtime error on NSDictionary extension method
We are developing remote desktop app on macOS and recently got user's report about unexpected app crash on macOS 15.2 beta. On macOS 15.2, there's strange app crash on NSDictionary extension method. We have narrowed down the steps and create the sample code to duplicate this issue. Create a cocoa app project in objective-c Try to access [NSNull null] value in NSDictionary Use specific method name for NSDictionary extension - (long long)longLongValueForKey:(NSString*)key withDefault:(long long)defaultValue; The console output for the example app is like below, the method pointer seems to be wrong when trying to get value with longLongValueForKey:withDefault: method to a [NSNull null] object. ********* longLongValueForKey: a: 0 ********* longLongValueForKey: b: 100 ********* longLongValueForKey: c: 0 ********* longLongValueForKey:withDefault: a: -1 ********* longLongValueForKey:withDefault: b: 100 ********* exception: -[NSNull longLongValue]: unrecognized selector sent to instance 0x7ff8528d9760 ********* longLongValueForKey:withDefault1: a: -1 ********* longLongValueForKey:withDefault1: b: 100 ********* longLongValueForKey:withDefault1: c: -1 Please create an objective-c app project and add below code to reproduce this issue. // // AppDelegate.m // DictionaryTest // // Created by splashtop on 2024/11/13. // #import "AppDelegate.h" #define IsNullObject(id) ((!id) || [id isKindOfClass:[NSNull class]]) @interface NSDictionary (extension) (long long)longLongValueForKey:(NSString*)key; (long long)longLongValueForKey:(NSString*)key withDefault:(long long)defaultValue; (long long)longLongValueForKey:(NSString*)key withDefault1:(long long)defaultValue; @end @interface AppDelegate () @property (strong) IBOutlet NSWindow *window; @end @implementation AppDelegate (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application NSDictionary* dict = @{ @"b" : @(100), @"c" : [NSNull null], }; @try { long long a = [dict longLongValueForKey:@"a"]; NSLog(@"********* longLongValueForKey: a: %lld", a); long long b = [dict longLongValueForKey:@"b"]; NSLog(@"********* longLongValueForKey: b: %lld", b); long long c = [dict longLongValueForKey:@"c"]; NSLog(@"********* longLongValueForKey: c: %lld", c); } @catch(NSException* e) { NSLog(@"********* exception: %@", e); } @try { long long a = [dict longLongValueForKey:@"a" withDefault:-1]; NSLog(@"********* longLongValueForKey:withDefault: a: %lld", a); long long b = [dict longLongValueForKey:@"b" withDefault:-1]; NSLog(@"********* longLongValueForKey:withDefault: b: %lld", b); long long c = [dict longLongValueForKey:@"c" withDefault:-1]; NSLog(@"********* longLongValueForKey:withDefault: c: %lld", c); } @catch(NSException* e) { NSLog(@"********* exception: %@", e); } @try { long long a = [dict longLongValueForKey:@"a" withDefault1:-1]; NSLog(@"********* longLongValueForKey:withDefault1: a: %lld", a); long long b = [dict longLongValueForKey:@"b" withDefault1:-1]; NSLog(@"********* longLongValueForKey:withDefault1: b: %lld", b); long long c = [dict longLongValueForKey:@"c" withDefault1:-1]; NSLog(@"********* longLongValueForKey:withDefault1: c: %lld", c); } @catch(NSException* e) { NSLog(@"********* exception: %@", e); } } @end @implementation NSDictionary (extension) (long long)longLongValueForKey:(NSString*)key { long long defaultValue = 0; id value = [self objectForKey:key]; if (IsNullObject(value) || value == [NSNull null]) { return defaultValue; } if ([value isKindOfClass:[NSNumber class]] || [value isKindOfClass:[NSString class]]) { return [value longLongValue]; } return defaultValue; } (long long)longLongValueForKey:(NSString*)key withDefault:(long long)defaultValue { id value = [self objectForKey:key]; if (IsNullObject(value) || value == [NSNull null]) { return defaultValue; } if ([value isKindOfClass:[NSNumber class]] || [value isKindOfClass:[NSString class]]) { return [value longLongValue]; } return defaultValue; } (long long)longLongValueForKey:(NSString*)key withDefault1:(long long)defaultValue { id value = [self objectForKey:key]; if (IsNullObject(value) || value == [NSNull null]) { return defaultValue; } if ([value isKindOfClass:[NSNumber class]] || [value isKindOfClass:[NSString class]]) { return [value longLongValue]; } return defaultValue; } @end
1
0
72
6d
Shortcuts not appearing in Shortcuts.app
I'm curious if anyone else has figured out why an intent defined in the intents file never seems to appear in the Shortcuts app on MacOS. I'm following the steps outlined in "Meet Shortcuts for MacOS" from WWDC 2021. https://developer.apple.com/videos/play/wwdc2021/10232 I build and run my app, launch Shortcuts, and the intent I defined refuses to show up! There's one caveat - I allowed Xcode to update to 16.1, and mysteriously the intent became available in Shortcuts.app. When I went to add a second intent, I see the same as above - it simply never shows up in Shortcuts.app. I have a few intents I'd like to write/add, but this build/test cycle is really slowing me down. This app is a completely fresh Swift-AppKit app, I've never archived it, so there shouldn't be more than one copy on disk. I have also cleaned the build folder, restarted Xcode, restarted Shortcuts, restarted my machine entirely... Anyone see this before and find a workaround? Any advice on how to give Shortcuts.app a kick in the rear to try and find my second intent?
0
0
52
6d