Posts under App & System Services topic

Post

Replies

Boosts

Views

Activity

AW10 and iPhone 16 notifications not working while using CarPlay
I just switched back to Apple Watch from Garmin, and in the time away I got both work and personal vehicles with CarPlay. I've noticed that my AW10 does not get ANY notifications pushed to it while I am using CarPlay, which is annoying because only texts and calls get pushed to my CarPlay screen, so i miss everything else. Additionally, and this may be a bug issue with iOS18, but I also just noticed that my phone (16) does not light up/make sounds for notifications while using CarPlay - so it doesn't light up, nor do the vehicle speakers make sound with IG/snapchat/etc notifications, and even the screen "lock" sound doesn't audibly go off. I've only had CarPlay for a few months, but I typically keep my phone on Silent anyway, so maybe I'm just noticing this now and its not necessarily a new issue? it does make the sound when i get a text, so logically everything else should make a noise. I've made sure that my general focus and car focus modes are OFF. Sound is ON. Sound volume setting is all the way up. Have also restarted both phone and watch, and “forgot“ the phone from the vehicle and reconnected Am I doing something wrong here? is there a solution for either problem? From what I've seen, some people say that the AW not getting notifications at the same time as Carplay is a built-in safety feature, which most people do not want... maybe its the same with the phone not alerting to non-text/call notifications?
1
0
532
Sep ’24
Apple tax for products inside game
I work as QA and we develop mobile farm game. Inside our game we have shop where user can buy coins or special prem.coins. And interface shows price with Apple Tax. Also we have battle pass, and when user want to buy battle pass the price shows without Apple tax. Anybody knows what is wrong? Pass price inside game > 9.99$ Price when user want to buy it > 11.99
0
0
285
Oct ’24
Questions regarding PIN code pairing in AccessorySetupKit
Hi, we are trying out AccessorySetupKit on our app for pairing with an IoT device via Bluetooth. I can see from this WWDC2024 talk Meet AccessorySetupKit that ASK supports BLE pairing methods with a PIN code. Is that enabled through this bluetoothPairingLE option on ASAccessory.SupportOptions? Is it correctly understood that this is referring to the Secure Simple Pairing feature in the BLE specs? This might be due to my unfamiliarity with Secure Simple Pairing, but does it require the PIN code again after it has been paired but disconnected and then re-connected? Any help here would be greatly appreciated.
1
0
376
Sep ’24
iOS 18 didFinishLaunchingWithOptions called during prewaming
Hi, I have seen a lot of answers in different threads Thread 1, Thread 2 that if an app doesn't support scenes, didFinishLaunchingWithOptions shouldn't be called during prewarming. Additionally, DTS Engineer on this Thread 3 mentioned that starting from late iOS 15, didFinishLaunchingWithOptions definitely won't be called during prewarming. However, we are still seeing in our logs, that didFinishLaunchingWithOptions is called during prewarming, for some users, even on iOS 18. Our app doesn't support scenes, and our AppDelegate is completely Objective-C. The problem is that in didFinishLaunchingWithOptions we set up our CoreData and Networking stack then we make a network request to fetch data and store it in database. When the app is launching in a prewarming state, CoreData stack can't load the persistent stores because the protected data isn't accessible during prewarming. We are setting the FileProtectionType to completeUnlessOpen for NSPersistentStoreDescription, which means the Core Data files are considered protected data. When user eventually launches app, network request resumes and crashes when trying to store data in database because Persistent Stores not loaded. What would you recommend to resolve this issue? Rewriting the Core Data stack for lazy initialization is quite challenging since we're using an old library (RestKit) for networking and Core Data caching. Thanks.
1
0
533
Sep ’24
Downloading files from iCloud
I'm trying to safely perform the apparently complex task for a cloud storage API, namely "downloading files", but it seems like iCloud APIs are comically broken beyond repair: -[NSFileCoordinator coordinateAccessWithIntents:queue:byAccessor:] calls the accessor block before all files have finished downloading. The same API will also return success (called the block with error == nil) even if the download fails (e.g. the phone is in airplane mode). I both cases, the files requested by the intents will not exist. -[NSFileManager startDownloadingUbiquitousItemAtURL:error:] does not have a completion block (Why?!?!) Similarly, this API will return success even if it fails (e.g. airplane mode) Manually checking NSURLUbiquitousItemIsDownloadingKey is broken as well, failed downloads (e.g. Airplane mode again) will retain their "Downloading" status, and NSURLUbiquitousItemDownloadingErrorKey is never updated. How can one safely download a file from iCloud if all of the APIs are broken?
6
0
1.1k
Oct ’24
Overlapping Segments and Duplicate Start Times in Workout Data
Hello, We're encountering overlapping segments and discrepancies when analyzing running/workout data for a 5-mile run. The expected splits for the run are: 8:39 9:06 8:30 8:39 8:43 0:08 However, the raw data includes segments where start times begin before the previous segment ends, and there are duplicate start times. Below is a sample of the raw data: "startDate": "2024-09-09T19:32:00.308-0400", "eventType": "segment", "eventTypeInt": 7, "endDate": "2024-09-09T19:37:56.135-0400" }, { "startDate": "2024-09-09T19:32:00.308-0400", "eventType": "segment", "eventTypeInt": 7, "endDate": "2024-09-09T19:41:08.476-0400" },``` // Here's an example of where the second segment start time falls in side the first segments startDate and endDate "startDate": "2024-09-09T19:54:22.658-0400", "eventType": "segment", "eventTypeInt": 7, "endDate": "2024-09-09T19:59:41.215-0400" }, { "startDate": "2024-09-09T19:58:44.624-0400", "eventType": "segment", "eventTypeInt": 7, "endDate": "2024-09-09T20:07:23.216-0400"
8
0
879
Sep ’24
NFCTagReaderSession host card emulation (HCE) exception
I'm trying to read a tag generated by my app that emulates event input tags; in my NFC reader app and I get this error: <NSXPCConnection: 0x300a108c0> connection to service with pid 62 named com.apple.nfcd.service.corenfc: Exception caught during decoding of received selector didDetectExternalReaderWithNotification:, dropping incoming message. Exception: Exception while decoding argument 0 (#2 of invocation): Exception: decodeObjectForKey: class "NFFieldNotificationECP1_0" not loaded or does not exist ( 0 CoreFoundation 0x0000000192b00f2c 76A3B198-3C09-323E-8359-0D4978E156F5 + 540460 1 libobjc.A.dylib 0x000000018a9a32b8 objc_exception_throw + 60 2 Foundation 0x0000000191932584 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 38276 3 Foundation 0x0000000191930d10 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 32016 4 Foundation 0x000000019198f460 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 418912 5 Foundation 0x000000019198c510 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 406800 6 Foundation 0x00000001919e4cf4 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 769268 7 Foundation 0x00000001919e3a60 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 764512 8 Foundation 0x00000001919e31c4 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 762308 9 Foundation 0x00000001919e307c D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 761980 10 libxpc.dylib 0x00000001ef5a1cbc CD0F76A8-713A-3FDB-877E-386B089BC2D1 + 72892 11 libxpc.dylib 0x00000001ef5a3908 CD0F76A8-713A-3FDB-877E-386B089BC2D1 + 80136 12 libdispatch.dylib 0x000000010401e87c _dispatch_client_callout4 + 20 13 libdispatch.dylib 0x000000010403bec4 _dispatch_mach_msg_invoke + 516 14 libdispatch.dylib 0x00000001040264a4 _dispatch_lane_serial_drain + 376 15 libdispatch.dylib 0x000000010403cea8 _dispatch_mach_invoke + 480 16 libdispatch.dylib 0x00000001040264a4 _dispatch_lane_serial_drain + 376 17 libdispatch.dylib 0x000000010402743c _dispatch_lane_invoke + 460 18 libdispatch.dylib 0x0000000104034404 _dispatch_root_queue_drain_deferred_wlh + 328 19 libdispatch.dylib 0x0000000104033a38 _dispatch_workloop_worker_thread + 444 20 libsystem_pthread.dylib 0x00000001ef550934 _pthread_wqthread + 288 21 libsystem_pthread.dylib 0x00000001ef54d0cc start_wqthread + 8 ) ( 0 CoreFoundation 0x0000000192b00f2c 76A3B198-3C09-323E-8359-0D4978E156F5 + 540460 1 libobjc.A.dylib 0x000000018a9a32b8 objc_exception_throw + 60 2 Foundation 0x000000019198f680 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 419456 3 Foundation 0x000000019198c510 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 406800 4 Foundation 0x00000001919e4cf4 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 769268 5 Foundation 0x00000001919e3a60 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 764512 6 Foundation 0x00000001919e31c4 D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 762308 7 Foundation 0x00000001919e307c D27A6EC5-943C-3B0E-8D15-8840FD2914F0 + 761980 8 libxpc.dylib 0x00000001ef5a1cbc CD0F76A8-713A-3FDB-877E-386B089BC2D1 + 72892 9 libxpc.dylib 0x00000001ef5a3908 CD0F76A8-713A-3FDB-877E-386B089BC2D1 + 80136 10 libdispatch.dylib 0x000000010401e87c _dispatch_client_callout4 + 20 11 libdispatch.dylib 0x000000010403bec4 _dispatch_mach_msg_invoke + 516 12 libdispatch.dylib 0x00000001040264a4 _dispatch_lane_serial_drain + 376 13 libdispatch.dylib 0x000000010403cea8 _dispatch_mach_invoke + 480 14 libdispatch.dylib 0x00000001040264a4 _dispatch_lane_serial_drain + 376 15 libdispatch.dylib 0x000000010402743c _dispatch_lane_invoke + 460 16 libdispatch.dylib 0x0000000104034404 _dispatch_root_queue_drain_deferred_wlh + 328 17 libdispatch.dylib 0x0000000104033a38 _dispatch_workloop_worker_thread + 444 18 libsystem_pthread.dylib 0x00000001ef550934 _pthread_wqthread + 288 19 libsystem_pthread.dylib 0x00000001ef54d0cc start_wqthread + 8 )
2
0
668
Sep ’24
NetworkMonitor.isConnected is always false on the watchOS
I tried building some app logic around NetworkMonitor.isConnected in my watch app (I want to trigger an update when the user opens the app and isConnected == true, otherwise observe NetworkMonitor.isConnected until it changes to true), and I found out that on a real device, NetworkMonitor.isConnected is always false. This does not seem to be documented anywhere. Am I right in assuming NetworkMonitor is not to be trusted on the watch? watchOS version is 18. I found an old post where eskimo argues that NWPathMonitor is not useful on the watch (which is also not documented), is it the same for NetworkMonitor? https://forums.developer.apple.com/forums/thread/127080
1
0
366
Sep ’24
Thread Error with @Model Class
I have a @Model class that is comprised of a String and a custom Enum. It was working until I added raw String values for the enum cases, and afterwards this error and code displays when opening a view that uses the class: { @storageRestrictions(accesses: _$backingData, initializes: _type) init(initialValue) { _$backingData.setValue(forKey: \.type, to: initialValue) _type = _SwiftDataNoType() } get { _$observationRegistrar.access(self, keyPath: \.type) return self.getValue(forKey: \.type) } set { _$observationRegistrar.withMutation(of: self, keyPath: \.type) { self.setValue(forKey: \.type, to: newValue) } } } Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1cc165d0c) I removed the String raw values but the error persists. Any guidance would be greatly appreciated. Below is replicated code: @Model class CopingSkillEntry { var stringText: String var case: CaseType init(stringText: String, case: CaseType) { self.stringText = stringText self.case = case } } enum CaseType: Codable, Hashable { case case1 case case1 case case3 }
2
0
448
Oct ’24
NSManagedObjectContext save leads to _thereIsNoSadnessLikeTheDeathOfOptimism
I have been investigating a crash where saving a context leads to a crash triggered internally by Core Data. Is there any information on what exception or fatal error it is? Or any hint of any kind which leads to NSManagedObjectContext.m:1475 (seems like this line calls abort or some sort of fatal error). Seems like this happens when the app is in background. Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x000000019266a3f8 Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Terminating Process: exc handler [38173] Triggered by Thread: 9 … Thread 9 Crashed: 0 CoreData 0x000000019266a3f8 -[NSManagedObjectContext _thereIsNoSadnessLikeTheDeathOfOptimism] + 36 (NSManagedObjectContext.m:1475) 1 CoreData 0x00000001925c8fa0 -[NSManagedObjectContext save:] + 1844 (NSManagedObjectContext.m:1688) 2 MyApp 0x0000000102cc747c closure #1 in DatabaseContainer.write(_:completion:) (in MyApp) (DatabaseContainer.swift:233) + 7861372 3 MyApp 0x0000000102baab14 thunk for @escaping @callee_guaranteed () -> () (in MyApp) (<compiler-generated>:0) + 6695700 4 CoreData 0x000000019252dfe8 developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3985) 5 libdispatch.dylib 0x00000001922e2dd4 _dispatch_client_callout + 20 (object.m:576) 6 libdispatch.dylib 0x00000001922ea400 _dispatch_lane_serial_drain + 748 (queue.c:3900) 7 libdispatch.dylib 0x00000001922eaf30 _dispatch_lane_invoke + 380 (queue.c:3991) 8 libdispatch.dylib 0x00000001922f5cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998) 9 libdispatch.dylib 0x00000001922f5528 _dispatch_workloop_worker_thread + 404 (queue.c:6592) 10 libsystem_pthread.dylib 0x00000001e6e8c934 _pthread_wqthread + 288 (pthread.c:2696) 11 libsystem_pthread.dylib 0x00000001e6e890cc start_wqthread + 8 (:-1)
3
0
956
Sep ’24
ANCS
After a prolonged BLE connection, we have noticed that ANCS frequently pushes a large number of "remove" messages (event ID 0x02), after which the device no longer receives any notifications. Is this behavior a result of system design, or could it be a potential bug? I would appreciate any insights or experiences that others can share.
2
0
366
Sep ’24
Detecting if mac is screen sharing
Hi, I am trying to determine if the Mac that is running my app has an active screen sharing session or not. Is there a way to detect this? Potentially using system API's or a system command? Any help would be greatly appreciated, thank you!
2
0
411
Oct ’24
NEDNSSettings with onDemandRule for .wifi or .cellular
Hi, Is it possible to get NEDNSSettings to enable for only .wifi or only .cellular? I tried using interfaceTypeMatch = .wifi standalone and I also tried it together with a NEEvaluateConnectionRule matching all domains but it skips using the EDNSSettings also on .cellular even if .interfaceTypeMatch is .wifi. This is the more advanced example of the two and it seems to not care about the interfaceTypeMatch flag: let evaluateRule = NEEvaluateConnectionRule(matchDomains: [], andAction: .neverConnect) let evaluateConnectionRule = NEOnDemandRuleEvaluateConnection() evaluateConnectionRule.connectionRules = [evaluateRule] evaluateConnectionRule.interfaceTypeMatch = .wiFi self.dnsManager.onDemandRules = [evaluateConnectionRule] Should this be possible or does it only work with VPN?
0
0
250
Oct ’24
Generating and receiving token for Push Notifications stopped working
Hi, hope you're all doing well. I have a real brain-cracker here... Have been looking into this for the past 20 hours, but can't figure it out. We built an iPhone app that essentially functions as a shell around a PWA Web-App using WebView. The tricky part here to set things up was getting the Push Notifications to work. Eventually we got this working though (with help of Firebase), and the app has been working great for the past 7 months. Now, all of a sudden as it seems, when users first open up the app, there's no FCM token generated and passed on to the WebView instance running javascript. Or at least, the listening event ('push-token') no longer gets fired. Users who already have their FCM token generated and stored earlier on, receive push notifications without any issues. It's just that no new FCM tokens seem to be generated - or at least no longer passed to the WebView's javascript code. I know this for a fact as my tests turn out that the following event (present in my PWA Web-App JS code) no longer gets fired. Again, this worked fine before. I have NOT updated the native app since 6-7 months. `/* LISTEN FOR FCM (PUSH MESSAGES) TOKEN FROM NATIVE (IOS) SHELL: */ window.addEventListener('push-token', function(event) { //alert("Push Token registration event called from native shell"); if (event && event.detail) { var token = event.detail; window.fcmPushMessageToken = token; localStorage.setItem('fcmPushMessageToken', token); //alert("Received FCM token: " + token); registerDeviceForPushMessages(); } });` Hereé the part in my native iOS code that used to call this event from within the native iOS shell: func handleFCMToken(){ DispatchQueue.main.async(execute: { Messaging.messaging().token { token, error in if let error = error { print("Error fetching FCM registration token: \(error)") checkViewAndEvaluate(event: "push-token", detail: "ERROR GET TOKEN") } else if let token = token { print("FCM registration token: \(token)") checkViewAndEvaluate(event: "push-token", detail: "'\(token)'") } } }) } func checkViewAndEvaluate(event: String, detail: String) { if (!EPDriversApp2.WebView.isHidden && !EPDriversApp2.WebView.isLoading ) { DispatchQueue.main.async(execute: { EPDriversApp2.WebView.evaluateJavaScript("this.dispatchEvent(new CustomEvent('\(event)', { detail: \(detail) }))") }) } else { DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { checkViewAndEvaluate(event: event, detail: detail) } } } Again, I have not updated the native iOS app OR the WebApp's code. This just stopped functioning all of a sudden. One "weird" thing I noticed that there's no Provisiong Profile associated with the app. I'm not sure whether this was ever the case before, to be honest. Is this even mandatory? Can not having a Provisiong Profile associated with the app effect the ability of an already pusblished app for generating Push Notification tokens?
1
0
1.1k
Oct ’24
Local notification shown in iphone not shown on apple watch
I created a local notification as follows: func scheduleNotification(title: String, subtitle: String = "", date: Date, id: String) { // Extract the components from the date let calendar = Calendar.current let hour = calendar.component(.hour, from: date) let minute = calendar.component(.minute, from: date) let second = calendar.component(.second, from: date) // Set the extracted components into DateComponents var dateComponents = DateComponents() dateComponents.hour = hour dateComponents.minute = minute dateComponents.second = second let content = UNMutableNotificationContent() content.title = title content.subtitle = subtitle content.sound = UNNotificationSound.default let action1 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.label, options: []) let action2 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.label, options: []) let category = UNNotificationCategory(identifier: "reminderCategory", actions: [action1, action2], intentIdentifiers: [], options: []) UNUserNotificationCenter.current().setNotificationCategories([category]) content.categoryIdentifier = "reminderCategory" let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) let request = UNNotificationRequest(identifier: id, content: content, trigger: trigger) // add our notification request UNUserNotificationCenter.current().add(request) } and I also have func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { // Handle foreground presentation options completionHandler([.sound, .badge]) } but for some reason the notification only shown on the phone. I've made sure that the phone is locked, apple watch is unlocked and also the notification setting in the watch app for this app is set to mirror.
0
0
489
Oct ’24
SQLLite 3 and iOS 18
Hi, I've got an app using SQLLite. Under iOS 17 I could insert and select rows with no issues. Under iOS 18 the same code runs without errors but the select returns no results. Various select statements with and without where clause's, and freshly created database files all behave the same way. Unless... the phone is in developer mode, then it works same as iOS 17. I'm assuming it's some security change, how do we fix it? Same issue with Swift 5 and Swift 6 for context but I don't think its related to Swift. Thanks !
5
0
336
Oct ’24