Posts under App & System Services topic

Post

Replies

Boosts

Views

Activity

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
118
1w
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
157
1w
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
512
1w
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
192
1w
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
212
1w
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
198
1w
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
1w
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
265
1w
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
144
1w
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
165
1w
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
1
125
1w
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
171
1w
HealthKit multiple queries performance questions
We're building two apps that rely almost exclusively on HealthKit, so we run a high volume of queries against a single shared HKHealthStore — mostly HKSampleQuery, plus HKStatisticsQuery and HKQuantitySeriesSampleQuery where needed. We also use HKObserverQuery for background processing and widget updates. The data is sleep, body metrics, and workouts. As our feature set grew, so did data-loading time, to the point of being a noticeable annoyance for users. To speed things up we moved from serial to concurrent queries. Mechanism: we issue the batch via a ThrowingTaskGroup — each child task calls execute() and awaits the completion handler through a continuation — with up to ~30 queries in flight concurrently against the one shared store. Symptom: The app doesn't freeze and the queries start fine, but their results sometimes take 30s+ to come back. Most of the times the same data fetch takes only a couple of seconds. There's no clear pattern except that it happens far more often on foregrounding. Environment: Devices we use for testing are iPhone 17 Pro and iPhone 15 pro both running iOS 26.5. Since the symptoms are hard to catch we're using text file logging to time the data layer responses. We're considering bounding concurrency to a small N via a capped task group, or reverting to serial — but both feel like either a regression or added complexity we can't justify without understanding the real cause. Questions: When we start ~30 queries at once against a single HKHealthStore, does HealthKit actually run them in parallel, or do they get handled one-at-a-time (or rate-limited) behind the scenes? Is there a sensible upper limit on how many queries we should run at once? Should we cap it to a small number, or does that not help because the system serializes them anyway? (Also: is sharing one HKHealthStore across the app the right approach?) Why would this happen mainly when the app comes to the foreground? A few possibilities we'd like confirmed or ruled out: the device hasn't been unlocked yet so health data isn't available, the connection to the HealthKit service is being re-established after backgrounding, general contention, or our background HKObserverQuery work blocking the foreground queries. Can HKObserverQuery background work get in the way of foreground queries? If so, is there a recommended way to pause or coordinate it when the app becomes active? Thank you
0
1
130
1w
Prevent SwiftData Upserts
Following the premise that database integrity should be handled by rules in the schema as much as possible, the automatic UPSERT whereby trying to create a record with the same unique key as a record that already exists does not trigger an INSERT error but automatically updates the existing record is pretty alien. I really don't want to enforce this on business logic and I want the backend to do the work. Is there away to prevent the UPSERT?
0
0
164
1w
DeviceActivityReport inconsistencies
Hello, I want to echo the DeviceActivityReport "concurrency" problems flagged in https://developer.apple.com/forums/thread/720549, and ask a related question. (Thanks to Kmart and other Apple dev support folks who have been monitoring these forums and responding diligently.) I would like to display daily and weekly stats in the same view, broken down by specific apps (as in the native Screen Time). However, instantiating multiple DeviceActivityReport objects with different filters and/or different contexts leads to confusion, where the two views will incorrectly and intermittently swap data or duplicate data where it shouldn't (seemingly upon some interval when the extension provides fresh data). There isn't documentation on how to display multiple reports at once. Is the idea that logic for multiple reports should be embedded within the extension itself in the makeConfiguration() function and there should only be a single DeviceActivityReport in the main App, or is this a bug? Even with a single DeviceActivityReport, I run into inconsistencies where the View provided by the extension takes multiple seconds to load or fails to load altogether. The behavior seems random...I will build the application with the same code multiple times and see different behavior each time. Finally, a plug for better support in the Simulator for the entire set of Screen Time APIs. Thanks!
6
1
2.3k
1w
Push provisioning failing.
Hello, We are trying to provision in apple wallet, I am getting an error "Card can not be added". Please check below and let me know if I am missing anything. SEID: 04401D7BCE578001930001236930311377D86C15D956BBA1 TimeStamp: 2025-08-18 11:53:04.570431-0500. CST Last 4 FPAN: 2345 Thanks
2
0
644
1w
Under what circumstances does @Query call body?
Hi I was wondering under what circumstances does @Query call body. Does it call it when the result set changes? E.g. object added/removed/moved. Does it also call when the result set is the same but a property of a model changed? I'd prefer 1, since models are @Observable my Views can handle tracking if they need to update when a property of a model changes. But I am concerned it is 2 which would cause unnecessary calls to body? E.g. a ForEach would needlessly be reinit since the model array is exactly the same. So which is it? By the way it would be useful if the docs could be updated with this important info. Thanks
1
0
222
1w
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
118
Activity
1w
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
157
Activity
1w
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
231
Activity
1w
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
512
Activity
1w
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
192
Activity
1w
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
178
Activity
1w
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
212
Activity
1w
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
198
Activity
1w
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
1w
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
265
Activity
1w
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
144
Activity
1w
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
165
Activity
1w
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
1
Views
125
Activity
1w
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
171
Activity
1w
HealthKit multiple queries performance questions
We're building two apps that rely almost exclusively on HealthKit, so we run a high volume of queries against a single shared HKHealthStore — mostly HKSampleQuery, plus HKStatisticsQuery and HKQuantitySeriesSampleQuery where needed. We also use HKObserverQuery for background processing and widget updates. The data is sleep, body metrics, and workouts. As our feature set grew, so did data-loading time, to the point of being a noticeable annoyance for users. To speed things up we moved from serial to concurrent queries. Mechanism: we issue the batch via a ThrowingTaskGroup — each child task calls execute() and awaits the completion handler through a continuation — with up to ~30 queries in flight concurrently against the one shared store. Symptom: The app doesn't freeze and the queries start fine, but their results sometimes take 30s+ to come back. Most of the times the same data fetch takes only a couple of seconds. There's no clear pattern except that it happens far more often on foregrounding. Environment: Devices we use for testing are iPhone 17 Pro and iPhone 15 pro both running iOS 26.5. Since the symptoms are hard to catch we're using text file logging to time the data layer responses. We're considering bounding concurrency to a small N via a capped task group, or reverting to serial — but both feel like either a regression or added complexity we can't justify without understanding the real cause. Questions: When we start ~30 queries at once against a single HKHealthStore, does HealthKit actually run them in parallel, or do they get handled one-at-a-time (or rate-limited) behind the scenes? Is there a sensible upper limit on how many queries we should run at once? Should we cap it to a small number, or does that not help because the system serializes them anyway? (Also: is sharing one HKHealthStore across the app the right approach?) Why would this happen mainly when the app comes to the foreground? A few possibilities we'd like confirmed or ruled out: the device hasn't been unlocked yet so health data isn't available, the connection to the HealthKit service is being re-established after backgrounding, general contention, or our background HKObserverQuery work blocking the foreground queries. Can HKObserverQuery background work get in the way of foreground queries? If so, is there a recommended way to pause or coordinate it when the app becomes active? Thank you
Replies
0
Boosts
1
Views
130
Activity
1w
Printing issue with HP printer
I've updated to macOS Golden Gate beta, now I can't print. I'm using HP printer. Anyone plz help.
Replies
0
Boosts
0
Views
113
Activity
1w
Prevent SwiftData Upserts
Following the premise that database integrity should be handled by rules in the schema as much as possible, the automatic UPSERT whereby trying to create a record with the same unique key as a record that already exists does not trigger an INSERT error but automatically updates the existing record is pretty alien. I really don't want to enforce this on business logic and I want the backend to do the work. Is there away to prevent the UPSERT?
Replies
0
Boosts
0
Views
164
Activity
1w
DeviceActivityReport inconsistencies
Hello, I want to echo the DeviceActivityReport "concurrency" problems flagged in https://developer.apple.com/forums/thread/720549, and ask a related question. (Thanks to Kmart and other Apple dev support folks who have been monitoring these forums and responding diligently.) I would like to display daily and weekly stats in the same view, broken down by specific apps (as in the native Screen Time). However, instantiating multiple DeviceActivityReport objects with different filters and/or different contexts leads to confusion, where the two views will incorrectly and intermittently swap data or duplicate data where it shouldn't (seemingly upon some interval when the extension provides fresh data). There isn't documentation on how to display multiple reports at once. Is the idea that logic for multiple reports should be embedded within the extension itself in the makeConfiguration() function and there should only be a single DeviceActivityReport in the main App, or is this a bug? Even with a single DeviceActivityReport, I run into inconsistencies where the View provided by the extension takes multiple seconds to load or fails to load altogether. The behavior seems random...I will build the application with the same code multiple times and see different behavior each time. Finally, a plug for better support in the Simulator for the entire set of Screen Time APIs. Thanks!
Replies
6
Boosts
1
Views
2.3k
Activity
1w
Push provisioning failing.
Hello, We are trying to provision in apple wallet, I am getting an error "Card can not be added". Please check below and let me know if I am missing anything. SEID: 04401D7BCE578001930001236930311377D86C15D956BBA1 TimeStamp: 2025-08-18 11:53:04.570431-0500. CST Last 4 FPAN: 2345 Thanks
Replies
2
Boosts
0
Views
644
Activity
1w
Under what circumstances does @Query call body?
Hi I was wondering under what circumstances does @Query call body. Does it call it when the result set changes? E.g. object added/removed/moved. Does it also call when the result set is the same but a property of a model changed? I'd prefer 1, since models are @Observable my Views can handle tracking if they need to update when a property of a model changes. But I am concerned it is 2 which would cause unnecessary calls to body? E.g. a ForEach would needlessly be reinit since the model array is exactly the same. So which is it? By the way it would be useful if the docs could be updated with this important info. Thanks
Replies
1
Boosts
0
Views
222
Activity
1w