Posts under App & System Services topic

Post

Replies

Boosts

Views

Activity

WeatherKit JWT token generation fails with WDSJWTAuthenticator Code=2 despite correct entitlement
I enabled the WeatherKit capability on my App ID (com.saimcan.darkweather, Team 6SWSD6V4ZC) about 12 hours ago. The entitlement is embedded in the binary and the provisioning profile authorizes it, but every request fails at the JWT generation step. Error from the logs: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" Relevant log excerpt (iOS 26.4 Simulator, same result on a physical device): [AuthService] Calling process is 3rd party process and has the correct entitlement ... accepting the connection [AuthService] Received proxy request for generating a jwt token. url=https://weatherkit.apple.com [WeatherDataService] Starting to generate JWT token request. bundleIdentifier=com.saimcan.darkweather [AuthService] Signed successfully [WeatherDataService] Make new JWT token request. requestIdentifier=... [AuthService] Failed to generate jwt token ... Code=2 What I have verified: Active Apple Developer Program membership (renewed through April 2027) All agreements accepted WeatherKit capability enabled on the App ID codesign -d --entitlements confirms com.apple.developer.weatherkit in the built binary embedded.mobileprovision also includes com.apple.developer.weatherkit App Group (group.com.saimcan.darkweather.shared) correctly bound to both the app and widget App IDs Since "Signed successfully" is logged, the device-side auth plumbing is working. The rejection appears to be server-side. Could someone from the WeatherKit team check whether JWT minting is enabled for this Team ID / Bundle ID? Team ID: 6SWSD6V4ZC Bundle ID: com.saimcan.darkweather
5
1
495
5d
Supported way to expose an iPhone+controller as a macOS gamepad without restricted entitlements?
I’m prototyping a personal-use system that lets an iPhone with a physically attached controller act as an input device for a Mac. End goal: Use the iPhone as the transport and sensor host Use the attached physical controller for buttons/sticks Map the iPhone gyroscope to the controller’s right stick to get gyro aim in Mac games / cloud-streamed games such as GeForce NOW that don't support the gyro. What I’m trying to understand is whether Apple supports any path for this on macOS that does NOT require restricted entitlements or paid-program-only capabilities. What I’ve already found: CoreHID virtual HID device creation appears to require com.apple.developer.hid.virtual.device HIDDriverKit / system extensions appear to require Apple-granted entitlements as well GCVirtualController does not seem to solve the problem because I need a controller-visible device that other apps can see, not just controls inside my own app So my concrete question is: Is there any supported, entitlement-free way for a personal macOS app to expose a game-controller-like input device that other apps can consume system-wide? If not, is the official answer that this class of solution necessarily requires one of: CoreHID with restricted entitlement HIDDriverKit/system extension entitlement some other Apple-approved framework or program I’m missing I’m not asking about App Store distribution. This is primarily for local/personal use during development. I’m trying to understand the supported platform boundary before investing further. Any guidance on the recommended architecture for this use case would be appreciated.
4
1
541
5d
DriverKit kernel crash, possible PCI bridge issue?
DriverKit kernel crash, possible PCI bridge issue? In working on a DriverKit driver for a legacy SCSI controller, we have finally arrived at the expected (and usually joyful) point in driver development - a repeatable kernel crash and reboot. It happens when the controller first attempts to do "real work" by accessing requests or replies provided to it by the driver. I will provide additional information below (and can share more), but it’s a bit tricky because there is a lot of steps required to get to the point where the PCIe card is sufficiently initialized to respond, presumably attempt a memory access, and bring down the whole system. The system freezes and reboots write after the first MemoryWrite32 with an address of a request. The address is properly (we believe) mapped, using IODMACommand et al, approximately like so: uint64_t reqArrSize = MPT_REQUEST_AREA * kMaxTasks; IOAddressSegment arrseg = {}; IOMemoryMap * arrmap = nullptr; ret = IOBufferMemoryDescriptor::Create(kIOMemoryDirectionInOut, reqArrSize, 0, &ivars->fReqArrayDesc); if (ret != kIOReturnSuccess) { … } IODMACommandSpecification dmaspec = {}; dmaspec.options = kIODMACommandSpecificationNoOptions; dmaspec.maxAddressBits = 32; // tried 31 here but that fails to allocate, the addresses start at 80000000, then leads to a crash // but that seems to be a bridge / SID issue, not the address itself ret = IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaspec, &ivars->fReqArrayDMA); if (ret != kIOReturnSuccess) { … } ivars->fReqArrayDMA->retain(); uint64_t dmaFlags = 0; uint32_t segCount = 1; // capacity in; actual out IOAddressSegment segs[1] = {}; ret = ivars->fReqArrayDMA->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, ivars->fReqArrayDesc, 0, reqArrSize, &dmaFlags, &segCount, segs); if ((ret != kIOReturnSuccess ) || (segCount != 1)) {…} ivars->fReqArrayPhys = segs[0].address; ivars->fReqArrayDesc->CreateMapping(0,0,0,0,0, &arrmap); // virtual mapping ivars->fReqArray = (uint8_t *)(arrmap ? arrmap->GetAddress() : 0); // virtual ivars->fReqFreemap.set(); // mark all request entries as free memset(ivars->fReqArray, 0, reqArrSize); The crash is very violent and consistent: panic(...): "dart-apciec0 (...): DART DART exception SID 0 ERROR_STATUS 0x80000001 ERROR_ADDRESS 0x0000000080000000 (no exceptionInfo)" @AppleT8110DART.cpp:1720 The fault address is the address we write to one of the controller's control register. We suspect that the issue is that this card uses an 8114 bridge, which uses its SID for the request, instead of the (scsi controller chip) endpoint. The mapping, meanwhile, is under the endpoint’s SID. So when the controller attempts its first request using the physical address, the mapping does not exist at the right level - which brings down the whole system. pcic0-bridge 0x106b/0x1015 Apple TB PCIe port └ pci-bridge 0x1b21/0x2461 ASMedia (TB tunnel) └ pci-bridge 0x1b21/0x2461 ASMedia IOPCITunnelled=Yes └ pci-bridge 0x10b5/0x8114 - (on the controller card) PLX PEX 8114, PCIe-to-PCI-X bridge └ scsi@8 0x1000/0x0030 - (on the controller card), LSI, on bus 4 (PCI-X secondary side) Worse yet, there appears to be no way form within a DEXT to ask for a mapping at a different level, and the 8114 doesn’t have a mapper of its own anyway (attempting to do so with a separate DEXT fails). That last part we know because we tried a workaround with two DEXTs, one that successfully matches the 8114 bridge and the other that matches the SCSI controller chip itself. However, the bridge doesn’t have a mapper attached and so the OS does not seem to give us a useful address (using the same IOBufferMemoryDescriptor::Create, ODMACommand::Create, PrepareForDMA sequence), and 32 bit request simply fails with kIOReturnMessageTooLarge. Attached is a quick diagram of our suspicions and a longer write-up (far warning, unlike the above, that is mostly AI output but it’s been reviewed by the team). Questions: Have others dealt with this problem of legacy PCI devices that have bridges that don’t fit neatly into the restrictions, and what did you do? Is there a way to get the right virtual<->physical mappings recognized at the right level? Is there a way to temporarily turn off SID checking or is that (as I assume) intrinsic to how this works? Are we on the wrong track entirely?
0
0
126
6d
WorkoutKit Feature Request: Distance & Time based IntervalBlock
Today, IntervalBlock only supports a fixed iteration count: IntervalBlock(steps: [IntervalStep], iterations: Int) This works well when the athlete knows exactly how many rounds they want to perform, but a lot of structured running and cycling workouts terminate a repeating block based on cumulative distance or cumulative elapsed time instead. These constructs are first-class on Garmin Connect, TrainingPeaks, FinalSurge, and similar platforms, but there's no way to express them in WorkoutKit's CustomWorkout. We've had to either fall back to a fixed iteration count (which forces us to guess the user's pace) or skip Apple Workout scheduling for these workouts entirely, which is a poor experience for athletes on watchOS. Proposal: // Today (still supported) IntervalBlock(steps: steps, iterations: 5) // Proposed IntervalBlock(steps: steps, until: .distance(5, .kilometers)) IntervalBlock(steps: steps, until: .time(30, .minutes)) IntervalBlock(steps: steps, iterations: 8) // unchanged Example Workouts with proposed features: "Run/walk until 5 km" Run for a minute, then walk for 30 seconds until completing a 5K. "30-minute fartlek" Repeat a hard/easy pair until cumulative time hits 30 min "10 km tempo with surges" Surge/recover until total distance hits 10 km. FB: FB23359408
0
0
75
6d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) (Device iPhone 17 Pro Max - Apple Watch Series 9) Any more suggestions on how to fix this? Thanks everybody!
5
0
99
6d
provider(_:didActivate:) callback intermittently not triggered, causing widespread audio loss for users
Hi everyone, I am facing a critical issue where the CallKit provider delegate method provider(_:didActivate:) is intermittently not triggered. This occasionally results in a total loss of audio during some VoIP calls, while other calls work perfectly fine. Here is the sequence of steps I am currently implementing: Report Incoming Call: The app receives a VoIP push notification and reports the call using reportNewIncomingCall(with:update:completion:). Answer Action: The user taps the answer button, and the app processes the CXAnswerCallAction. Configure Audio Session: Inside the provider delegate, I configure the AVAudioSession category and mode (e.g., setting category to .playAndRecord and mode to .voiceChat). Note: As per Apple's guidelines, I do not call setActive(true) manually, expecting CallKit to activate it automatically. Despite following this standard flow, there are times when provider(_:didActivate:) is skipped entirely, meaning the audio engine fails to initialize for that specific call session. We are currently receiving a large volume of user complaints regarding this issue, as it heavily impacts the core calling experience in production. Could an Apple engineer or anyone from the community look into this? Any insights into what might be causing CallKit to occasionally fail to activate the audio session or how to work around this would be highly appreciated. Thank you!
1
0
132
6d
isEligibleForAgeFeatures and different legal requirements for different regions
https://developer.apple.com/documentation/DeclaredAgeRange/AgeRangeService/isEligibleForAgeFeatures returns a bool. I assume that means that it will return True for the states where their laws are in effect. The TX law and the UT/LA/AZ laws have different requirements though: TX requires the app verify the user's age on every app launch. These other states require the app verify the user's age "no more than once during each 12-month period" A future law (Brazil maybe?) might do something else. How can we determine if the user is eligible for the TX versus other state requirements?
2
1
480
6d
HAL Plugin (AudioServerPlugin) — Plugin_StartIO never called from AUHAL input client
I'm building a virtual audio device using the HAL Plugin (AudioServerPlugin) API on macOS. The plugin loads correctly, WriteMix is called with non-zero audio data, but Plugin_StartIO is never called from my app's AUHAL input client. Environment: macOS 26.5 Xcode (latest) Bundle ID: com.private.SubON Plugin installed at: /Library/Audio/Plug-Ins/HAL/SubONHALPlugin.driver What works: Plugin loads and is visible as "SubON Virtual Device" Plugin_AddDeviceClient is called with bundleID=com.private.SubON WriteMix is called with non-zero maxSrc values (audio is reaching the plugin) AUHAL setup completes: EnableIO input=1 output=0, CurrentDevice set correctly, AudioUnitInitialize succeeds pre-start readback confirms: currentDevice matches, enableIOIn=1 What doesn't work: Plugin_StartIO is never called from the SubON.app input client WillDoIOOperation is never called ReadInput is never called maxAmplitude in the input tap is always 0.0 AUHAL setup code (Swift): AudioUnitUninitialize(auhal) AudioUnitSetProperty(auhal, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &one, size) AudioUnitSetProperty(auhal, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &zero, size) AudioUnitSetProperty(auhal, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &deviceID, size) AudioUnitInitialize(auhal) HAL Plugin — WillDoIOOperation: outWillDo = true; outWillDoInPlace = true; Returns true for both ReadInput and WriteMix. Observation: Even when selecting "SubON Virtual Device" as the system input device in System Settings, Plugin_StartIO is still never called. Any ideas what could prevent Plugin_StartIO from being called despite AUHAL configuration appearing correct?
0
0
119
6d
StoreKit returns 0 subscriptions on TestFlight — Apple IAP payment sheet never opens (Capacitor + RevenueCat)
Hello, I'm developing a Capacitor/Next.js iOS app with RevenueCat for auto-renewable subscriptions. On a real iPhone via TestFlight, StoreKit never returns my subscription products, so the Apple payment sheet never appears. App TestFlight builds tested: 110, 111, 112 (iOS 1.1.0) In-App Purchase capability enabled on App ID Paid Applications Agreement: active Banking/tax: active Subscription product IDs (auto-renewable, same subscription group) vytalai_premium_monthly vytalai_premium_yearly vytalai_premium_yearly_intro (exit offer) What happens Install app from TestFlight on physical iPhone Navigate to paywall App calls RevenueCat → Purchases.getProducts() with the 3 product IDs above StoreKit returns 0 products (or configure/getProducts times out) UI shows: "Apple Store: 0 subscriptions on this device — Sandbox popup cannot open" Tapping subscribe does not open the Apple payment sheet Fallback prices appear (3.49 / 29.99) instead of live App Store prices (3,49 € / 29,99 €), which suggests StoreKit is not returning products. What we already verified Correct bundle ID in build metadata NEXT_PUBLIC_REVENUECAT_API_KEY_IOS (appl_*) embedded in EAS production build Provisioning profile regenerated and active Subscription metadata corrected (was Rejected, now Waiting for Review) All 3 subscriptions attached to app version submission RevenueCat offering "default" with monthly, annual, and annual_intro packages App Store Server Notifications URL configured to RevenueCat Legal pages open in-app (no external cookie banner on native) Testing on TestFlight only (not Safari/web) App Review context We received Guideline 2.1(b) rejections because: Error on purchase page Exit offer (50% OFF / €1.91 per month equivalent) referenced product vytalai_premium_yearly_intro which was not submitted for review initially — now added and submitted with the app version. Question Even with subscriptions in "Waiting for Review" state and metadata completed, should StoreKit Sandbox/TestFlight return these products on device so we can test the payment sheet before approval? If not, what exact App Store Connect state is required for StoreKit to return products on TestFlight? Any guidance on why getProducts would return 0 for valid product IDs on a TestFlight build would be greatly appreciated. Thank you.
2
0
156
6d
NSJSONSerialization silently drops U+FEFF from JSON string content — keys merge, characters vanish
NSJSONSerialization silently drops U+FEFF from JSON string content — keys merge, characters vanish TL;DR: NSJSONSerialization deletes U+FEFF (ZERO WIDTH NO-BREAK SPACE / BOM) from anywhere inside parsed JSON strings — not just a leading document BOM, and even when written as the \uFEFF escape (it's removed after unescaping). Distinct strings/keys silently collapse onto their U+FEFF-less twins. If you're seeing JSON keys mysteriously merge or a character disappear from a parsed value, this is probably why. It is not your code. Workaround and exhaustive scope below. The workaround Two options, depending on how attached you are to Foundation: A. Stay on NSJSONSerialization — swap U+FEFF for a private-use sentinel before parsing, restore after. You must handle both the raw bytes and the \uFEFF escape (the escape bites too, since deletion happens post-unescape): // 1. Pick a private-use scalar you've verified is absent from the source text. // 2. Replace every in-content U+FEFF (raw char AND \uFEFF escape) with it. // 3. Parse. NSJSONSerialization preserves the sentinel. // 4. Recursively restore the sentinel -> U+FEFF in the parsed tree. static id RestoreSentinel(id o, NSString *s, NSString *bom) { if ([o isKindOfClass:NSString.class]) return [o rangeOfString:s].location == NSNotFound ? o : [o stringByReplacingOccurrencesOfString:s withString:bom]; if ([o isKindOfClass:NSArray.class]) { NSMutableArray *a = [NSMutableArray arrayWithCapacity:[o count]]; for (id e in o) [a addObject:RestoreSentinel(e, s, bom)]; return a; } if ([o isKindOfClass:NSDictionary.class]) { NSMutableDictionary *d = [NSMutableDictionary dictionary]; [o enumerateKeysAndObjectsUsingBlock:^(id k, id v, BOOL *stop) { d[RestoreSentinel(k, s, bom)] = RestoreSentinel(v, s, bom); }]; return d; } return o; } Swap the escape form with a backslash-parity-aware regex so \uFEFF (escaped backslash + literal "uFEFF") is left intact: (?<!\\)((?:\\\\)*)\\u[Ff][Ee][Ff][Ff] -> $1<sentinel> B. Don't use Foundation for this file — a spec-compliant C parser like ++yyjson++ preserves U+FEFF and is faster on large files. (This is the route swift-transformers took for tokenizer.json.) Minimal repro // Object keys collapse: NSData *d1 = [@"{\"\\uFEFF#\":1,\"#\":2}" dataUsingEncoding:NSUTF8StringEncoding]; id o1 = [NSJSONSerialization JSONObjectWithData:d1 options:0 error:nil]; // EXPECTED: 2 keys ("\uFEFF#" and "#"); ACTUAL: 1 key ("#") — \uFEFF stripped, keys merged // String content lost: NSData *d2 = [@"[\"\\uFEFF\"]" dataUsingEncoding:NSUTF8StringEncoding]; id o2 = [NSJSONSerialization JSONObjectWithData:d2 options:0 error:nil]; // EXPECTED: ["\uFEFF"] (one code point); ACTUAL: [""] (empty string) Same outcome whether U+FEFF arrives as raw EF BB BF bytes or the \uFEFF escape. Why this is a bug, not a quirk Per RFC 8259 §7, a JSON string is a sequence of Unicode code points; U+FEFF is ordinary content and doesn't require escaping. Tolerating a leading document BOM is fine — deleting U+FEFF from string content is not. U+FEFF leads a double life (BOM signal vs. ZERO WIDTH NO-BREAK SPACE character); Foundation treats every occurrence as a stray BOM to scrub. Scope — exhaustive, not anecdotal I swept all 1,112,064 valid Unicode scalars (U+0000–U+10FFFF minus surrogates) through a parse round-trip, in both the \uFEFF-escape and raw-UTF-8 forms: U+FEFF is the only scalar altered. Every other scalar round-trips byte-identically — including the other zero-widths (U+200B, U+2060, U+00A0), which all survive. No Unicode normalization occurs (NFD stays decomposed, combining sequences and compatibility characters are preserved). So this is a deliberate BOM-stripping heuristic applied too broadly to string content — narrow and fixable, not general mangling. Why it's nasty in practice U+FEFF is zero-width, so the corruption is invisible — no trace in a diff or editor. Real-world hit: ML tokenizer vocabularies (e.g. Google's Gemma) legitimately contain U+FEFF-bearing tokens; loading tokenizer.json via NSJSONSerialization collapses those keys and assigns wrong token IDs, with zero visible symptom until output is subtly wrong. Filed as FB23271905 — please dupe if this has bitten you. More duplicates is what gets it triaged.
4
0
151
6d
Can reproduce in SpeakerBox that CallKit doesn't activate audiosession when call finished by remote caller
I can reproduce the bug that CallKit doesn't active audiosession after the outgoing call put on hold because of an incoming call. VoIP calling with CallKit Steps to reproduce: Download SpeakerBox example app from the link above and start it with XCode Start a new outgoing call Call your phone from other phone Hold and Accept the call After a few secs finish the call from the other phone The outgoing call will be still on hold Click on the call and click Toggle Hold The call won't be active again because the audiosession is activated. Logs: Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Requested transaction successfully Starting audio Type: stdio AURemoteIO.cpp:1162 failed: 561017449 (enable 3, outf< 1 ch, 44100 Hz, Float32> inf< 1 ch, 44100 Hz, Float32>) Type: Error | Timestamp: 2024-08-15 12:20:29.949437+02:00 | Process: Speakerbox | Library: libEmbeddedSystemAUs.dylib | Subsystem: com.apple.coreaudio | Category: aurioc | TID: 0x19540d AVAEInternal.h:109 [AVAudioEngineGraph.mm:1344:Initialize: (err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)): error 561017449 Type: Error | Timestamp: 2024-08-15 12:20:29.949619+02:00 | Process: Speakerbox | Library: AVFAudio | Subsystem: com.apple.avfaudio | Category: avae | TID: 0x19540d Couldn't start Apple Voice Processing IO: Error Domain=com.apple.coreaudio.avfaudio Code=561017449 "(null)" UserInfo={failed call=err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)} Type: Notice | Timestamp: 2024-08-15 12:20:29.949730+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d Route change: Type: Notice | Timestamp: 2024-08-15 12:20:30.167498+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d ReasonUnknown Type: Notice | Timestamp: 2024-08-15 12:20:30.167549+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d Previous route: Type: Notice | Timestamp: 2024-08-15 12:20:30.167568+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d <AVAudioSessionRouteDescription: 0x302c00bc0, inputs = ( "<AVAudioSessionPortDescription: 0x302c01330, type = MicrophoneBuiltIn; name = iPhone Mikrofon; UID = Built-In Microphone; selectedDataSource = (null)>" ); outputs = ( "<AVAudioSessionPortDescription: 0x302c004d0, type = Receiver; name = Vev\U0151; UID = Built-In Receiver; selectedDataSource = (null)>" )> Type: Notice | Timestamp: 2024-08-15 12:20:30.167626+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d
14
1
1.2k
6d
Simple question on
Hopefully a very quick question for anyone familiar with IOUserSCSIParallelInterfaceController - what is the right initialization to implement: init () override; Start (IOService * provider) override; UserInitializeController () override; something else Seems #3 is required, but guidance varies on the others, undoubtedly bc IOUserSCSI.. implements a lot of things beyond the usual DriverKit structure. Thanks in advance for any help. (We're trying to implement a driver for a legacy SCSI controller).
3
0
214
6d
How can an app determine whether a user is in Texas before calling requestAgeRange()?
Hello Apple Developer Team, I'm implementing the DeclaredAgeRange framework to support age assurance requirements related to Texas SB 2420. After reading the documentation for: AgeRangeService.shared.isEligibleForAgeFeatures I noticed the discussion states: "Check whether the person using your app is in a region that requires Age Assurance." My understanding is that isEligibleForAgeFeatures uses the user's location and account settings internally to determine whether age assurance requirements apply. However, I am unclear about the expected implementation flow. My questions are: Should developers manually determine whether a user is located in Texas (for example using Core Location, IP-based geolocation, or other methods) before calling requestAgeRange()? Or is Apple recommending that developers simply call: let eligible = try await AgeRangeService.shared.isEligibleForAgeFeatures and rely entirely on the framework to determine whether Texas age assurance requirements apply? If a user is located in Texas and age assurance is required, will isEligibleForAgeFeatures reliably return true without the app needing any location permission? Is there any supported API that allows developers to know which specific region/state triggered the age assurance requirement, or should developers treat isEligibleForAgeFeatures == true as the only signal needed? My goal is to implement the framework according to Apple's intended design while avoiding unnecessary collection of location data. Thank you for any clarification.
1
0
108
6d
NSPersistentCloudKitContainer.share() never invokes completion handler — private sync works perfectly
I'm adding CloudKit sharing to an app that already uses NSPersistentCloudKitContainer successfully. Private-database sync works flawlessly across my devices. But every attempt to create a share hangs: container.share(_:to:) never returns and never invokes its completion handler. No error is thrown, nothing prints, the operation simply stalls indefinitely. Environment: Xcode 26, iOS 26.5, iPhone 16 Paid Individual developer account Single NSPersistentCloudKitContainer, two stores (private + shared) What works: Private database sync across multiple devices (iPhone + iPad) is reliable eventChangedNotification reports setup/import/export events succeeding continuously CloudKit schema was initialized via initializeCloudKitSchema() and record types appear in the CloudKit Console The problem: Calling share on a root object hangs. I've reproduced the identical hang with all three API variants: async/await: try await container.share([object], to: nil) — never returns Completion handler: container.share([object], to: nil) { ... } — closure never fires UICloudSharingController preparation-closure initializer — the closure never fires, controller presents an empty sheet A log line immediately before the share call prints; a log line inside the completion/closure never does. My two-store setup (per WWDC21 session 10015): swiftlet sharedURL = privateDesc.url! .deletingLastPathComponent() .appendingPathComponent("YerBoat-Shared.sqlite") let sharedDesc = NSPersistentStoreDescription(url: sharedURL) let sharedOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.example.app") sharedOptions.databaseScope = .shared sharedDesc.cloudKitContainerOptions = sharedOptions sharedDesc.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) sharedDesc.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey) container.persistentStoreDescriptions = [privateDesc, sharedDesc] Possibly relevant: the objects I'm trying to share (and their related records via cascade relationships) were all created before I added the sharing/shared-store code. Could existing records in the default zone fail to migrate into a shareable zone, causing the hang? Questions: What causes share() to hang silently with no error and no completion? Does sharing require records to be created after the shared store exists, or should existing private-database records be shareable? Is there a required step between initializeCloudKitSchema() and the first share() call that I'm missing? I've reviewed WWDC21-10015 and TN3164. Any guidance appreciated.
1
0
93
6d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) Any more suggestions on how to fix this? Thanks everybody!
0
0
68
6d
Apple Pay Connectivity Test
I am trying to start implementing the Push Provisioning (Apple Pay) process for my website. I configured a test-environment and already had a 'success' connectivity test before, even though I did not implement any TLS validation api. but for about two weeks, there is that "Environment connectivity test is unavailable due to production maintenance." message. I don't know if earlier i managed to pass the tests for real, or if that is exactly a bug Apple is working on. This message comes and goes at least 2-3 times, and you can't tell if the connectivity test works as expected or is bugged.
0
0
112
6d
WeatherKit JWT token generation fails with WDSJWTAuthenticator Code=2 despite correct entitlement
I enabled the WeatherKit capability on my App ID (com.saimcan.darkweather, Team 6SWSD6V4ZC) about 12 hours ago. The entitlement is embedded in the binary and the provisioning profile authorizes it, but every request fails at the JWT generation step. Error from the logs: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" Relevant log excerpt (iOS 26.4 Simulator, same result on a physical device): [AuthService] Calling process is 3rd party process and has the correct entitlement ... accepting the connection [AuthService] Received proxy request for generating a jwt token. url=https://weatherkit.apple.com [WeatherDataService] Starting to generate JWT token request. bundleIdentifier=com.saimcan.darkweather [AuthService] Signed successfully [WeatherDataService] Make new JWT token request. requestIdentifier=... [AuthService] Failed to generate jwt token ... Code=2 What I have verified: Active Apple Developer Program membership (renewed through April 2027) All agreements accepted WeatherKit capability enabled on the App ID codesign -d --entitlements confirms com.apple.developer.weatherkit in the built binary embedded.mobileprovision also includes com.apple.developer.weatherkit App Group (group.com.saimcan.darkweather.shared) correctly bound to both the app and widget App IDs Since "Signed successfully" is logged, the device-side auth plumbing is working. The rejection appears to be server-side. Could someone from the WeatherKit team check whether JWT minting is enabled for this Team ID / Bundle ID? Team ID: 6SWSD6V4ZC Bundle ID: com.saimcan.darkweather
Replies
5
Boosts
1
Views
495
Activity
5d
Supported way to expose an iPhone+controller as a macOS gamepad without restricted entitlements?
I’m prototyping a personal-use system that lets an iPhone with a physically attached controller act as an input device for a Mac. End goal: Use the iPhone as the transport and sensor host Use the attached physical controller for buttons/sticks Map the iPhone gyroscope to the controller’s right stick to get gyro aim in Mac games / cloud-streamed games such as GeForce NOW that don't support the gyro. What I’m trying to understand is whether Apple supports any path for this on macOS that does NOT require restricted entitlements or paid-program-only capabilities. What I’ve already found: CoreHID virtual HID device creation appears to require com.apple.developer.hid.virtual.device HIDDriverKit / system extensions appear to require Apple-granted entitlements as well GCVirtualController does not seem to solve the problem because I need a controller-visible device that other apps can see, not just controls inside my own app So my concrete question is: Is there any supported, entitlement-free way for a personal macOS app to expose a game-controller-like input device that other apps can consume system-wide? If not, is the official answer that this class of solution necessarily requires one of: CoreHID with restricted entitlement HIDDriverKit/system extension entitlement some other Apple-approved framework or program I’m missing I’m not asking about App Store distribution. This is primarily for local/personal use during development. I’m trying to understand the supported platform boundary before investing further. Any guidance on the recommended architecture for this use case would be appreciated.
Replies
4
Boosts
1
Views
541
Activity
5d
Does a default App Clip link present the App Clip card when the full app is installed?
I would like to clarify the expected behavior of a default App Clip link. In my testing, the App Clip card was presented even though the full app was installed. Could you please confirm whether this is the intended behavior of a default App Clip link? Environment: Invocation source: Safari / Notes app Thank you for your assistance.
Replies
0
Boosts
0
Views
78
Activity
6d
DriverKit kernel crash, possible PCI bridge issue?
DriverKit kernel crash, possible PCI bridge issue? In working on a DriverKit driver for a legacy SCSI controller, we have finally arrived at the expected (and usually joyful) point in driver development - a repeatable kernel crash and reboot. It happens when the controller first attempts to do "real work" by accessing requests or replies provided to it by the driver. I will provide additional information below (and can share more), but it’s a bit tricky because there is a lot of steps required to get to the point where the PCIe card is sufficiently initialized to respond, presumably attempt a memory access, and bring down the whole system. The system freezes and reboots write after the first MemoryWrite32 with an address of a request. The address is properly (we believe) mapped, using IODMACommand et al, approximately like so: uint64_t reqArrSize = MPT_REQUEST_AREA * kMaxTasks; IOAddressSegment arrseg = {}; IOMemoryMap * arrmap = nullptr; ret = IOBufferMemoryDescriptor::Create(kIOMemoryDirectionInOut, reqArrSize, 0, &ivars->fReqArrayDesc); if (ret != kIOReturnSuccess) { … } IODMACommandSpecification dmaspec = {}; dmaspec.options = kIODMACommandSpecificationNoOptions; dmaspec.maxAddressBits = 32; // tried 31 here but that fails to allocate, the addresses start at 80000000, then leads to a crash // but that seems to be a bridge / SID issue, not the address itself ret = IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaspec, &ivars->fReqArrayDMA); if (ret != kIOReturnSuccess) { … } ivars->fReqArrayDMA->retain(); uint64_t dmaFlags = 0; uint32_t segCount = 1; // capacity in; actual out IOAddressSegment segs[1] = {}; ret = ivars->fReqArrayDMA->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, ivars->fReqArrayDesc, 0, reqArrSize, &dmaFlags, &segCount, segs); if ((ret != kIOReturnSuccess ) || (segCount != 1)) {…} ivars->fReqArrayPhys = segs[0].address; ivars->fReqArrayDesc->CreateMapping(0,0,0,0,0, &arrmap); // virtual mapping ivars->fReqArray = (uint8_t *)(arrmap ? arrmap->GetAddress() : 0); // virtual ivars->fReqFreemap.set(); // mark all request entries as free memset(ivars->fReqArray, 0, reqArrSize); The crash is very violent and consistent: panic(...): "dart-apciec0 (...): DART DART exception SID 0 ERROR_STATUS 0x80000001 ERROR_ADDRESS 0x0000000080000000 (no exceptionInfo)" @AppleT8110DART.cpp:1720 The fault address is the address we write to one of the controller's control register. We suspect that the issue is that this card uses an 8114 bridge, which uses its SID for the request, instead of the (scsi controller chip) endpoint. The mapping, meanwhile, is under the endpoint’s SID. So when the controller attempts its first request using the physical address, the mapping does not exist at the right level - which brings down the whole system. pcic0-bridge 0x106b/0x1015 Apple TB PCIe port └ pci-bridge 0x1b21/0x2461 ASMedia (TB tunnel) └ pci-bridge 0x1b21/0x2461 ASMedia IOPCITunnelled=Yes └ pci-bridge 0x10b5/0x8114 - (on the controller card) PLX PEX 8114, PCIe-to-PCI-X bridge └ scsi@8 0x1000/0x0030 - (on the controller card), LSI, on bus 4 (PCI-X secondary side) Worse yet, there appears to be no way form within a DEXT to ask for a mapping at a different level, and the 8114 doesn’t have a mapper of its own anyway (attempting to do so with a separate DEXT fails). That last part we know because we tried a workaround with two DEXTs, one that successfully matches the 8114 bridge and the other that matches the SCSI controller chip itself. However, the bridge doesn’t have a mapper attached and so the OS does not seem to give us a useful address (using the same IOBufferMemoryDescriptor::Create, ODMACommand::Create, PrepareForDMA sequence), and 32 bit request simply fails with kIOReturnMessageTooLarge. Attached is a quick diagram of our suspicions and a longer write-up (far warning, unlike the above, that is mostly AI output but it’s been reviewed by the team). Questions: Have others dealt with this problem of legacy PCI devices that have bridges that don’t fit neatly into the restrictions, and what did you do? Is there a way to get the right virtual<->physical mappings recognized at the right level? Is there a way to temporarily turn off SID checking or is that (as I assume) intrinsic to how this works? Are we on the wrong track entirely?
Replies
0
Boosts
0
Views
126
Activity
6d
Messages permanently notification
iOS 27 I can not clear this 1 on my iPad Pro. even after the latest update it still shows 1 unread.
Replies
0
Boosts
0
Views
75
Activity
6d
WorkoutKit Feature Request: Distance & Time based IntervalBlock
Today, IntervalBlock only supports a fixed iteration count: IntervalBlock(steps: [IntervalStep], iterations: Int) This works well when the athlete knows exactly how many rounds they want to perform, but a lot of structured running and cycling workouts terminate a repeating block based on cumulative distance or cumulative elapsed time instead. These constructs are first-class on Garmin Connect, TrainingPeaks, FinalSurge, and similar platforms, but there's no way to express them in WorkoutKit's CustomWorkout. We've had to either fall back to a fixed iteration count (which forces us to guess the user's pace) or skip Apple Workout scheduling for these workouts entirely, which is a poor experience for athletes on watchOS. Proposal: // Today (still supported) IntervalBlock(steps: steps, iterations: 5) // Proposed IntervalBlock(steps: steps, until: .distance(5, .kilometers)) IntervalBlock(steps: steps, until: .time(30, .minutes)) IntervalBlock(steps: steps, iterations: 8) // unchanged Example Workouts with proposed features: "Run/walk until 5 km" Run for a minute, then walk for 30 seconds until completing a 5K. "30-minute fartlek" Repeat a hard/easy pair until cumulative time hits 30 min "10 km tempo with surges" Surge/recover until total distance hits 10 km. FB: FB23359408
Replies
0
Boosts
0
Views
75
Activity
6d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) (Device iPhone 17 Pro Max - Apple Watch Series 9) Any more suggestions on how to fix this? Thanks everybody!
Replies
5
Boosts
0
Views
99
Activity
6d
provider(_:didActivate:) callback intermittently not triggered, causing widespread audio loss for users
Hi everyone, I am facing a critical issue where the CallKit provider delegate method provider(_:didActivate:) is intermittently not triggered. This occasionally results in a total loss of audio during some VoIP calls, while other calls work perfectly fine. Here is the sequence of steps I am currently implementing: Report Incoming Call: The app receives a VoIP push notification and reports the call using reportNewIncomingCall(with:update:completion:). Answer Action: The user taps the answer button, and the app processes the CXAnswerCallAction. Configure Audio Session: Inside the provider delegate, I configure the AVAudioSession category and mode (e.g., setting category to .playAndRecord and mode to .voiceChat). Note: As per Apple's guidelines, I do not call setActive(true) manually, expecting CallKit to activate it automatically. Despite following this standard flow, there are times when provider(_:didActivate:) is skipped entirely, meaning the audio engine fails to initialize for that specific call session. We are currently receiving a large volume of user complaints regarding this issue, as it heavily impacts the core calling experience in production. Could an Apple engineer or anyone from the community look into this? Any insights into what might be causing CallKit to occasionally fail to activate the audio session or how to work around this would be highly appreciated. Thank you!
Replies
1
Boosts
0
Views
132
Activity
6d
Local notifications delayed by up to 5 seconds on iOS 27
When scheduling a local notification, it can be delayed by up to 5 seconds. On iOS 26, the notification appears instantly at the scheduled time. Feedback ID: FB23218437
Replies
2
Boosts
0
Views
171
Activity
6d
isEligibleForAgeFeatures and different legal requirements for different regions
https://developer.apple.com/documentation/DeclaredAgeRange/AgeRangeService/isEligibleForAgeFeatures returns a bool. I assume that means that it will return True for the states where their laws are in effect. The TX law and the UT/LA/AZ laws have different requirements though: TX requires the app verify the user's age on every app launch. These other states require the app verify the user's age "no more than once during each 12-month period" A future law (Brazil maybe?) might do something else. How can we determine if the user is eligible for the TX versus other state requirements?
Replies
2
Boosts
1
Views
480
Activity
6d
HAL Plugin (AudioServerPlugin) — Plugin_StartIO never called from AUHAL input client
I'm building a virtual audio device using the HAL Plugin (AudioServerPlugin) API on macOS. The plugin loads correctly, WriteMix is called with non-zero audio data, but Plugin_StartIO is never called from my app's AUHAL input client. Environment: macOS 26.5 Xcode (latest) Bundle ID: com.private.SubON Plugin installed at: /Library/Audio/Plug-Ins/HAL/SubONHALPlugin.driver What works: Plugin loads and is visible as "SubON Virtual Device" Plugin_AddDeviceClient is called with bundleID=com.private.SubON WriteMix is called with non-zero maxSrc values (audio is reaching the plugin) AUHAL setup completes: EnableIO input=1 output=0, CurrentDevice set correctly, AudioUnitInitialize succeeds pre-start readback confirms: currentDevice matches, enableIOIn=1 What doesn't work: Plugin_StartIO is never called from the SubON.app input client WillDoIOOperation is never called ReadInput is never called maxAmplitude in the input tap is always 0.0 AUHAL setup code (Swift): AudioUnitUninitialize(auhal) AudioUnitSetProperty(auhal, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &one, size) AudioUnitSetProperty(auhal, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &zero, size) AudioUnitSetProperty(auhal, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &deviceID, size) AudioUnitInitialize(auhal) HAL Plugin — WillDoIOOperation: outWillDo = true; outWillDoInPlace = true; Returns true for both ReadInput and WriteMix. Observation: Even when selecting "SubON Virtual Device" as the system input device in System Settings, Plugin_StartIO is still never called. Any ideas what could prevent Plugin_StartIO from being called despite AUHAL configuration appearing correct?
Replies
0
Boosts
0
Views
119
Activity
6d
Intercepting the Native Phone Calls
Hello team, I am trying to develop a solution to intercept a native cellular phone call, process its conversation audio or screen call before it is been answered. Do we have any framework to build such kind of feature.
Replies
6
Boosts
0
Views
146
Activity
6d
StoreKit returns 0 subscriptions on TestFlight — Apple IAP payment sheet never opens (Capacitor + RevenueCat)
Hello, I'm developing a Capacitor/Next.js iOS app with RevenueCat for auto-renewable subscriptions. On a real iPhone via TestFlight, StoreKit never returns my subscription products, so the Apple payment sheet never appears. App TestFlight builds tested: 110, 111, 112 (iOS 1.1.0) In-App Purchase capability enabled on App ID Paid Applications Agreement: active Banking/tax: active Subscription product IDs (auto-renewable, same subscription group) vytalai_premium_monthly vytalai_premium_yearly vytalai_premium_yearly_intro (exit offer) What happens Install app from TestFlight on physical iPhone Navigate to paywall App calls RevenueCat → Purchases.getProducts() with the 3 product IDs above StoreKit returns 0 products (or configure/getProducts times out) UI shows: "Apple Store: 0 subscriptions on this device — Sandbox popup cannot open" Tapping subscribe does not open the Apple payment sheet Fallback prices appear (3.49 / 29.99) instead of live App Store prices (3,49 € / 29,99 €), which suggests StoreKit is not returning products. What we already verified Correct bundle ID in build metadata NEXT_PUBLIC_REVENUECAT_API_KEY_IOS (appl_*) embedded in EAS production build Provisioning profile regenerated and active Subscription metadata corrected (was Rejected, now Waiting for Review) All 3 subscriptions attached to app version submission RevenueCat offering "default" with monthly, annual, and annual_intro packages App Store Server Notifications URL configured to RevenueCat Legal pages open in-app (no external cookie banner on native) Testing on TestFlight only (not Safari/web) App Review context We received Guideline 2.1(b) rejections because: Error on purchase page Exit offer (50% OFF / €1.91 per month equivalent) referenced product vytalai_premium_yearly_intro which was not submitted for review initially — now added and submitted with the app version. Question Even with subscriptions in "Waiting for Review" state and metadata completed, should StoreKit Sandbox/TestFlight return these products on device so we can test the payment sheet before approval? If not, what exact App Store Connect state is required for StoreKit to return products on TestFlight? Any guidance on why getProducts would return 0 for valid product IDs on a TestFlight build would be greatly appreciated. Thank you.
Replies
2
Boosts
0
Views
156
Activity
6d
NSJSONSerialization silently drops U+FEFF from JSON string content — keys merge, characters vanish
NSJSONSerialization silently drops U+FEFF from JSON string content — keys merge, characters vanish TL;DR: NSJSONSerialization deletes U+FEFF (ZERO WIDTH NO-BREAK SPACE / BOM) from anywhere inside parsed JSON strings — not just a leading document BOM, and even when written as the \uFEFF escape (it's removed after unescaping). Distinct strings/keys silently collapse onto their U+FEFF-less twins. If you're seeing JSON keys mysteriously merge or a character disappear from a parsed value, this is probably why. It is not your code. Workaround and exhaustive scope below. The workaround Two options, depending on how attached you are to Foundation: A. Stay on NSJSONSerialization — swap U+FEFF for a private-use sentinel before parsing, restore after. You must handle both the raw bytes and the \uFEFF escape (the escape bites too, since deletion happens post-unescape): // 1. Pick a private-use scalar you've verified is absent from the source text. // 2. Replace every in-content U+FEFF (raw char AND \uFEFF escape) with it. // 3. Parse. NSJSONSerialization preserves the sentinel. // 4. Recursively restore the sentinel -> U+FEFF in the parsed tree. static id RestoreSentinel(id o, NSString *s, NSString *bom) { if ([o isKindOfClass:NSString.class]) return [o rangeOfString:s].location == NSNotFound ? o : [o stringByReplacingOccurrencesOfString:s withString:bom]; if ([o isKindOfClass:NSArray.class]) { NSMutableArray *a = [NSMutableArray arrayWithCapacity:[o count]]; for (id e in o) [a addObject:RestoreSentinel(e, s, bom)]; return a; } if ([o isKindOfClass:NSDictionary.class]) { NSMutableDictionary *d = [NSMutableDictionary dictionary]; [o enumerateKeysAndObjectsUsingBlock:^(id k, id v, BOOL *stop) { d[RestoreSentinel(k, s, bom)] = RestoreSentinel(v, s, bom); }]; return d; } return o; } Swap the escape form with a backslash-parity-aware regex so \uFEFF (escaped backslash + literal "uFEFF") is left intact: (?<!\\)((?:\\\\)*)\\u[Ff][Ee][Ff][Ff] -> $1<sentinel> B. Don't use Foundation for this file — a spec-compliant C parser like ++yyjson++ preserves U+FEFF and is faster on large files. (This is the route swift-transformers took for tokenizer.json.) Minimal repro // Object keys collapse: NSData *d1 = [@"{\"\\uFEFF#\":1,\"#\":2}" dataUsingEncoding:NSUTF8StringEncoding]; id o1 = [NSJSONSerialization JSONObjectWithData:d1 options:0 error:nil]; // EXPECTED: 2 keys ("\uFEFF#" and "#"); ACTUAL: 1 key ("#") — \uFEFF stripped, keys merged // String content lost: NSData *d2 = [@"[\"\\uFEFF\"]" dataUsingEncoding:NSUTF8StringEncoding]; id o2 = [NSJSONSerialization JSONObjectWithData:d2 options:0 error:nil]; // EXPECTED: ["\uFEFF"] (one code point); ACTUAL: [""] (empty string) Same outcome whether U+FEFF arrives as raw EF BB BF bytes or the \uFEFF escape. Why this is a bug, not a quirk Per RFC 8259 §7, a JSON string is a sequence of Unicode code points; U+FEFF is ordinary content and doesn't require escaping. Tolerating a leading document BOM is fine — deleting U+FEFF from string content is not. U+FEFF leads a double life (BOM signal vs. ZERO WIDTH NO-BREAK SPACE character); Foundation treats every occurrence as a stray BOM to scrub. Scope — exhaustive, not anecdotal I swept all 1,112,064 valid Unicode scalars (U+0000–U+10FFFF minus surrogates) through a parse round-trip, in both the \uFEFF-escape and raw-UTF-8 forms: U+FEFF is the only scalar altered. Every other scalar round-trips byte-identically — including the other zero-widths (U+200B, U+2060, U+00A0), which all survive. No Unicode normalization occurs (NFD stays decomposed, combining sequences and compatibility characters are preserved). So this is a deliberate BOM-stripping heuristic applied too broadly to string content — narrow and fixable, not general mangling. Why it's nasty in practice U+FEFF is zero-width, so the corruption is invisible — no trace in a diff or editor. Real-world hit: ML tokenizer vocabularies (e.g. Google's Gemma) legitimately contain U+FEFF-bearing tokens; loading tokenizer.json via NSJSONSerialization collapses those keys and assigns wrong token IDs, with zero visible symptom until output is subtly wrong. Filed as FB23271905 — please dupe if this has bitten you. More duplicates is what gets it triaged.
Replies
4
Boosts
0
Views
151
Activity
6d
Can reproduce in SpeakerBox that CallKit doesn't activate audiosession when call finished by remote caller
I can reproduce the bug that CallKit doesn't active audiosession after the outgoing call put on hold because of an incoming call. VoIP calling with CallKit Steps to reproduce: Download SpeakerBox example app from the link above and start it with XCode Start a new outgoing call Call your phone from other phone Hold and Accept the call After a few secs finish the call from the other phone The outgoing call will be still on hold Click on the call and click Toggle Hold The call won't be active again because the audiosession is activated. Logs: Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Received provider(_:didDeactivate:) Requested transaction successfully Starting audio Type: stdio AURemoteIO.cpp:1162 failed: 561017449 (enable 3, outf< 1 ch, 44100 Hz, Float32> inf< 1 ch, 44100 Hz, Float32>) Type: Error | Timestamp: 2024-08-15 12:20:29.949437+02:00 | Process: Speakerbox | Library: libEmbeddedSystemAUs.dylib | Subsystem: com.apple.coreaudio | Category: aurioc | TID: 0x19540d AVAEInternal.h:109 [AVAudioEngineGraph.mm:1344:Initialize: (err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)): error 561017449 Type: Error | Timestamp: 2024-08-15 12:20:29.949619+02:00 | Process: Speakerbox | Library: AVFAudio | Subsystem: com.apple.avfaudio | Category: avae | TID: 0x19540d Couldn't start Apple Voice Processing IO: Error Domain=com.apple.coreaudio.avfaudio Code=561017449 "(null)" UserInfo={failed call=err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)} Type: Notice | Timestamp: 2024-08-15 12:20:29.949730+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d Route change: Type: Notice | Timestamp: 2024-08-15 12:20:30.167498+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d ReasonUnknown Type: Notice | Timestamp: 2024-08-15 12:20:30.167549+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d Previous route: Type: Notice | Timestamp: 2024-08-15 12:20:30.167568+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d <AVAudioSessionRouteDescription: 0x302c00bc0, inputs = ( "<AVAudioSessionPortDescription: 0x302c01330, type = MicrophoneBuiltIn; name = iPhone Mikrofon; UID = Built-In Microphone; selectedDataSource = (null)>" ); outputs = ( "<AVAudioSessionPortDescription: 0x302c004d0, type = Receiver; name = Vev\U0151; UID = Built-In Receiver; selectedDataSource = (null)>" )> Type: Notice | Timestamp: 2024-08-15 12:20:30.167626+02:00 | Process: Speakerbox | Library: Speakerbox | TID: 0x19540d
Replies
14
Boosts
1
Views
1.2k
Activity
6d
Simple question on
Hopefully a very quick question for anyone familiar with IOUserSCSIParallelInterfaceController - what is the right initialization to implement: init () override; Start (IOService * provider) override; UserInitializeController () override; something else Seems #3 is required, but guidance varies on the others, undoubtedly bc IOUserSCSI.. implements a lot of things beyond the usual DriverKit structure. Thanks in advance for any help. (We're trying to implement a driver for a legacy SCSI controller).
Replies
3
Boosts
0
Views
214
Activity
6d
How can an app determine whether a user is in Texas before calling requestAgeRange()?
Hello Apple Developer Team, I'm implementing the DeclaredAgeRange framework to support age assurance requirements related to Texas SB 2420. After reading the documentation for: AgeRangeService.shared.isEligibleForAgeFeatures I noticed the discussion states: "Check whether the person using your app is in a region that requires Age Assurance." My understanding is that isEligibleForAgeFeatures uses the user's location and account settings internally to determine whether age assurance requirements apply. However, I am unclear about the expected implementation flow. My questions are: Should developers manually determine whether a user is located in Texas (for example using Core Location, IP-based geolocation, or other methods) before calling requestAgeRange()? Or is Apple recommending that developers simply call: let eligible = try await AgeRangeService.shared.isEligibleForAgeFeatures and rely entirely on the framework to determine whether Texas age assurance requirements apply? If a user is located in Texas and age assurance is required, will isEligibleForAgeFeatures reliably return true without the app needing any location permission? Is there any supported API that allows developers to know which specific region/state triggered the age assurance requirement, or should developers treat isEligibleForAgeFeatures == true as the only signal needed? My goal is to implement the framework according to Apple's intended design while avoiding unnecessary collection of location data. Thank you for any clarification.
Replies
1
Boosts
0
Views
108
Activity
6d
NSPersistentCloudKitContainer.share() never invokes completion handler — private sync works perfectly
I'm adding CloudKit sharing to an app that already uses NSPersistentCloudKitContainer successfully. Private-database sync works flawlessly across my devices. But every attempt to create a share hangs: container.share(_:to:) never returns and never invokes its completion handler. No error is thrown, nothing prints, the operation simply stalls indefinitely. Environment: Xcode 26, iOS 26.5, iPhone 16 Paid Individual developer account Single NSPersistentCloudKitContainer, two stores (private + shared) What works: Private database sync across multiple devices (iPhone + iPad) is reliable eventChangedNotification reports setup/import/export events succeeding continuously CloudKit schema was initialized via initializeCloudKitSchema() and record types appear in the CloudKit Console The problem: Calling share on a root object hangs. I've reproduced the identical hang with all three API variants: async/await: try await container.share([object], to: nil) — never returns Completion handler: container.share([object], to: nil) { ... } — closure never fires UICloudSharingController preparation-closure initializer — the closure never fires, controller presents an empty sheet A log line immediately before the share call prints; a log line inside the completion/closure never does. My two-store setup (per WWDC21 session 10015): swiftlet sharedURL = privateDesc.url! .deletingLastPathComponent() .appendingPathComponent("YerBoat-Shared.sqlite") let sharedDesc = NSPersistentStoreDescription(url: sharedURL) let sharedOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.example.app") sharedOptions.databaseScope = .shared sharedDesc.cloudKitContainerOptions = sharedOptions sharedDesc.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) sharedDesc.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey) container.persistentStoreDescriptions = [privateDesc, sharedDesc] Possibly relevant: the objects I'm trying to share (and their related records via cascade relationships) were all created before I added the sharing/shared-store code. Could existing records in the default zone fail to migrate into a shareable zone, causing the hang? Questions: What causes share() to hang silently with no error and no completion? Does sharing require records to be created after the shared store exists, or should existing private-database records be shareable? Is there a required step between initializeCloudKitSchema() and the first share() call that I'm missing? I've reviewed WWDC21-10015 and TN3164. Any guidance appreciated.
Replies
1
Boosts
0
Views
93
Activity
6d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) Any more suggestions on how to fix this? Thanks everybody!
Replies
0
Boosts
0
Views
68
Activity
6d
Apple Pay Connectivity Test
I am trying to start implementing the Push Provisioning (Apple Pay) process for my website. I configured a test-environment and already had a 'success' connectivity test before, even though I did not implement any TLS validation api. but for about two weeks, there is that "Environment connectivity test is unavailable due to production maintenance." message. I don't know if earlier i managed to pass the tests for real, or if that is exactly a bug Apple is working on. This message comes and goes at least 2-3 times, and you can't tell if the connectivity test works as expected or is bugged.
Replies
0
Boosts
0
Views
112
Activity
6d