Post

Replies

Boosts

Views

Activity

Feedbacks for DeclaredAgeRange - missing platform support
I've been writing about the DeclaredAgeRange a bit on LinkedIn and now it is time to take to the developer forums. In my efforts to prepare my apps for new local requirements, I've run across some rough edges. The DeclaredAgeRange API is missing on several platforms, and extension types. First and foremost, watchOS. An Apple Watch is a clear single user platform and for standalone apps, the DeclaredAgeRange being absent is felt by developers. FB20954931 - DeclaredAgeRange: Framework not available on watchOS making compliance a challenge for watchOS standalone apps In the same vein of thinking, while users on Apple Vision Pro are far fewer numbers than Apple Watch, it is also a miss. The tricky part would be testing on the simulator. So far I haven't gotten the simulator and sandbox testing to work and give real values across any platform. I don't think an Apple Store will let me try my app out via TestFlight on their devices and they're still too expensive to reasonably buy for most developers. Too bad Feedbacks are not a currency that developers can trade in for gear. FB20955020 - DeclaredAgeRange: Framework not available on visionOS making compliance a challenge for visionOS apps I'll recognize that the user model is different on tvOS, and that as a user while I have family group setup, I don't have any children on the account. I have to imagine that child accounts on an Apple TV exist and would be able to account for the sharing of age ranges to apps. Yes, the user could just switch profiles, but, app developers could still integrate the age range into their apps. Maybe it needs more robust system level support but here is the feedback just the same. FB20955029 - DeclaredAgeRange: Framework not available on tvOS making compliance a challenge on tvOS apps And finally, let's not forget about App Clips. While the App Clips might not be 'downloaded' from App Store itself, it is powered by App Store technologies to an extent. I'd rather not bifurcate my code more than it already is for the shared code between my apps and app clips. Rounding out platform support to App Clips, since it is iOS, would close the loop. FB20954846 - DeclaredAgeRange / App Clips: Add support for DeclaredAgeRange framework for App Clip targets - capability exist, Xcode cannot generate entitlement for it Oh wait, actually, not quite. To fully close the loop, make the DeclaredAgeRange work fully on macCatalyst. The documentation says it is compatible, but from my experiments trying to get it to even compile when targeting macCatalyst apps simply doesn't build. FB21117325 - DeclaredAgeRange: API documentation states available on mac catalyst - but fails to compile in Xcode 26.2
1
1
256
1w
DeclaredAgeRange framework and types missing much needed Sendable and Hashable conformance
Like any good developer, I try to add tests where I can. The AgeRangeService.AgeRange type does not provide an initializer. I know the routine, create an interface or a simple struct that I control and use that instead. Thanks to extensive time with frameworks like Core Bluetooth or Core Location, this is a well understood practice (looking at you CBPeripheral...). Great I'll make my own 'AgeRange' struct. Make it Hashable, make it Sendable, use the framework types as properties. Scratch that, most of the properties on AgeRangeService.AgeRange type are not Sendable and many are also not Hashable. This is proving to be challenging. I hope to open source my little Swift Package wrapper library for DeclaredAgeRange which will add types with full Hashable and Sendable conformance. I hope Apple updates the API and makes this obsolete. I don't see why these simple types can't be Hashable and Sendable. They're structs, enums, and OptionSets (structs). FB20959748 - DeclaredAgeRange: DeclaredAgeRangeAction is not sendable causing main actor compile errors with default isolation settings FB20960560 - DeclaredAgeRange: AgeRangeService.AgeRangeDeclaration is not sendable as expected FB20960574 - DeclaredAgeRange: AgeRangeService.ParentalControls is not sendable as expected FB20960590 - DeclaredAgeRange: AgeRangeService.ParentalControls is not hashable as expected On the note of the library and using the types as-is, there are some issues using the new cases in AgeRangeDeclaration and the isEligibelForAgeFeatures property. I started another thread over here: https://developer.apple.com/forums/thread/808144
0
1
127
3w
Bluetooth privacy usage prompt displayed immediately upon initialization of CBManager classes
iOS 13 is requesting Bluetooth permission immediately upon central manager initialization. From the Bluetooth 2019 talk, the presenter illustrated in the didUpdateState method to check the authorization state and appropriately prompt the user (presumably the same way you would with CMPedometer--invoke a instance method). Is this behavior to expected in the GM seed? It is counter intuitive and doesn't conform to the pattern that other frameworks use for their authorization workflow.This permission model seems to be incorrect, most other frameworks have a static method on the corresponding class to get authorization status. For example https://developer.apple.com/documentation/corelocation/cllocationmanager/1423523-authorizationstatus, https://developer.apple.com/documentation/coremotion/cmpedometer/2913743-authorizationstatus. The API signature that has a "notRequested" state, will seemingly never be the case since the prompt happens upon first initialization NOT first usage. CMPedometer initialization does not initiate the privacy prompt, only calling a method to do work does. CLLocationManager has explicit methods to invoke the authorization modal.If we don't have the class func to check authorization, and are dependent on an instance of CBCentralManager to have been initialized with a delegate, we can't design an elegant workflow to prompt the user at the appropriate time.
3
0
4k
Apr ’21
Xcode 13 Opaque UINavigationBar and Opaque UITabBar rendering issues
My application makes use of opaque navigation and tab bars in its layout. I also use modally presented nav bar controllers using the card style introduced in iOS 13. Everything looks clean and as expected when running the app compiled from Xcode 12 (Test Flight or App Store). When I run my project using Xcode 13, I'm getting really strange rendering behavior of the bars. In light appearance, they're black instead of opaque white in some cases. In another case, when I have a MKMapView filling the entirety of my view, the tab bar is totally invisible and there are just the blue tab bar items floating on top of the map. I have attached images of three different scenarios that visually render as expected on Xcode 12, but fail horribly when deployed via Xcode 13. Opaque Tab Bar w/ nav controller Opaque Tab Bar w/ map view inside view controller Opaque Tab Bar w/ Opaque Navigation Bar presented modally as card. I was able to produce these issues using both SwiftUI and UIKit via Storyboards I've filed two feedbacks with Apple and sent them a sample project. If anyone else is encountering this issue feel free to mention feedback in yours to upvote the issue. FB9611443 FB9207757 Hope this gets fixed before RC so I can send an app update in making use of new features!
2
0
1.9k
Sep ’21
Initialization order of SwiftUI Application + @UIApplicationDelegateAdaptor
In my application initializer, I set a property on ApplicationDelegate. It is a reference to my data controller that manages access to many things (core data model). It gets passed in there to handle launch keys and pushes, and is relied upon as a required dependency to many services--namely push, navigation actions (quick look, Siri intents, etc.). In summary, I want to clean up and move some initialization code from my application initializer (tons of compiler directives for multi targets, watch, app, etc.) to the respective application delegates. BUT this requires an assumption that didFinishLaunching will be called after a property is injected into app delegate. Is this a safe assumption to make? I have observed the didFinishLaunching getting invoked only AFTER the initializer of Application completes. Can this be relied upon in terms of dependency injection? Can this order be assumed? Application init Property assignment on app delegate within app init App delegate init Property is set (didSet fires) App initialization complete, return Delegate fires willFinishLaunching Delegate fires didFinishLaunching Other delegate methods fire accordingly I assume that the implementation of UIApplicationDelegateAdaptor under the hood is similar to the Coordinators in UIViewRepresentable where as soon as you try to access / assign something on it, then it constructs the object and assigns an instance to the property wrapper. Additionally, if it hadn't already been initialized, because it DOES need to call delegate callbacks, the system will invoke it had you not already assigned a property to initialize it.
1
0
2.5k
Mar ’22
Pre-order link preview in Messages app is showing unapproved/older App Store screenshot
I just released my app for pre-order and the message link preview in the Messages app for the listing is somehow using an older screenshot that was provided to App Store Connect weeks ago. I deleted and uploaded new screenshots just this weekend before sending in for review and everything looks correct in App Store Connect. I just confirmed what is showing in link previews does NOT match what was approved in App Store Connect. Has anyone else encountered similar issues when listing their apps for pre-order or just in general? What is really strange is that the image being shown in link previews was approved once, but I developer rejected it. Maybe some caching issue with Apple preemptively propagating the images when it was approved the first time before I chose to release it? Just speculating. FB11257903
2
0
1.2k
Aug ’22
Simulator not reflecting simctl override --time command as expected
I have a simulator named "iPhone 14 Pro" created and booted. The override --time command doesn't appear to take anymore. This worked months ago, but broke somewhere along the road of Xcode 14.x. It is a drag setting the system time to 9:41 for App Store Connect screenshots which is why I used the command in the first place. I cannot seem to successfully set the status bar time of the simulator via the following command anymore: xcrun simctl status_bar "iPhone 14 Pro" override --time "9:41" Is this working for anyone else lately? Feedbacks; Created these Dec 7, 2022 FB11859751 - Simulator: iOS simulator not responding to simctl set time FB11859744 - Simulator: watchOS simulator not responding to simctl set time
2
0
1.9k
Jan ’24
CKQueryOperation in private database produces 500 errors from server and in CloudKit Console
I've been scratching my head on this one. Out of the blue, part of my 'synchronization' mechanism that copies 'favorites' from device to device has stopped working. A user can save a favorite location and it will propagate to all of their other devices, or repopulate after an uninstall and reinstall. My code in the space hasn't changed for months and I haven't made any schema changes to this type either. Last night I noticed the process wasn't working anymore. My CKQueryOperation result completion is returning this error: <CKError 0x2818a16b0: "Server Rejected Request" (15/2001); "Request failed with http status code 500"; uuid = 2CA523A6-8F39-4538-98AF-E9B7D6CACF73> What is telling to me is that the CloudKit Console also fails with an internal error when I try to query this type in MY private database for two different accounts. I can query another type in the private database but this one won't work for two of the Apple ID's I have tried. Also interesting, if I query this type in the PUBLIC database, even though this type is only saved to the private database, that operation succeeds just fine. I don't want to burn a DTS ticket for a server issue. FB13543186 - CloudKit: Receiving 500 when performing a query operation on the private database CloudKit status page is green on the developer site as of this morning.
3
0
1.1k
Apr ’24
Running commands for symbolication within the App Sandbox for Mac App Store
I'm trying to build a developer tools app that can run in the app sandbox and execute commands related to working with DSYM files. The app sandbox is a requirement for publishing it to the App Store. I come from the world of iOS so everything is a sandbox to me and this is new territory. To execute my commands I'm using the Process type to invoke command line. func execute() throws -> CommandResult { let task = Process() let standardOutput = Pipe() let standardError = Pipe() task.standardOutput = standardOutput task.standardError = standardError task.arguments = ["-c", command] task.executableURL = URL(fileURLWithPath: "/bin/zsh") task.standardInput = nil let outHandle = standardOutput.fileHandleForReading let errorHandle = standardError.fileHandleForReading try task.run() let out1 = outHandle.readDataToEndOfFile() let out2 = errorHandle.readDataToEndOfFile() // more code interpreting the pipes I'm trying to perform the following operations: mdfind to locate DSYMs https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report#Locate-a-dSYM-using-Spotlight dwarfdump to verify UUIDs https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report#Match-build-UUIDs atos to symbolicate with the found DYSM file https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report#Symbolicate-the-crash-report-with-the-command-line This all works just fine when I run my Mac app without sandboxing, but as one would expect totally fails when App Sandbox is enabled--the sandbox is doing its thing. Responses like "xcrun cannot be used within an App Sandbox", or simply the output not finding anything because the scope of the process is limited to the sandbox, not where my app DSYM file is. In my readings on the documentation, where it states that I can create a command line helper tool that gets installed alongside the app sandbox app. "Add a command-line tool to a sandboxed app's Xcode project to the resulting app can run it as a helper tool." https://developer.apple.com/documentation/security/app_sandbox Is this the right path to take? Or is there a way to still achieve access to xcrun by asking the user to grant access to other parts of the system via dialogue prompts? I have followed this guide but don't know where to go from here: https://developer.apple.com/documentation/xcode/embedding-a-helper-tool-in-a-sandboxed-app It leaves off at print("Hello World") and no instructions on how to have your app communicate with the helper from what I could find ... :). I know, generally speaking, of XPC services and that I have the ability to make them on macOS, unlike iOS (wait maybe 17.4 allows it? https://developer.apple.com/documentation/xpc anyways). Would creating an XPC helper be allowed to execute commands against xcrun or have access to the ~/Library/Developer/Xcode path to find the debug symbols for the purposes of symbolicating a crash report? I really want to be able to ship my app on the App Store and enable developers to use the tool super easy, but I'm not sure if the App Sandbox will prevent me from achieving what I'm trying to do or not. Any tips, pointers, samples, guidance is much appreciated!
1
0
1.2k
Feb ’24
Production Issue - MetricKit is not generating daily metric payloads as expected since iOS 18
I'm a big fan of MetricKit. I decided to see how my apps are performing with iOS 18 and well, I'm not getting any metric payloads from those devices. Metric payloads received from my test devices adopting iOS 18 has pretty much bottomed out to zero. Is anyone getting MetricKit MXMetricPayloads from iOS 18 devices? FB15461298 - MetricKit: Production issue / regression with iOS 18 - Significant dropout or metric payloads being generated since 18.0 - nearly no reports To demonstrate the issue, I decided to graph the metric payloads my infrastructure receives for all of my apps across all of my devices over the last 16 months starting with WWDC23 timeframe. This data is grouped by count per month. A trend can easily be seen starting in June 2024 where I started to adopt iOS 18 betas. Zooming in since WWDC24, grouped by week, it is much easier to see the decline. Note, the second screenshot shows data collected from Xcode builds, TestFlight, and App Store. The last data point from today was a manual creation from Xcode's Debug window, so at least that triggering mechanism works and I can confirm all of my code to upload off device works as expected. On the bright side, I guess I will ship this 'payload received over time' feature in my MetricKit payload analyzer app with a scrolling window and group by features that make up these screenshots.
2
0
844
Oct ’24
CloudKit CKModifyRecordsOperation resulting in undocumented error "Internal Error" (1/3001); "MMCSEngineCreate failed"
I'm running into an undocumented error coming back from CloudKit operations. Specifically, I'm attempting to save new records via CKModifyRecordsOperation. I'm receiving this error for each of the records in the perRecordSaveBlock callback: <CKError 0x3018ac3c0: "Internal Error" (1/3001); "MMCSEngineCreate failed"> Is anyone else facing this error? It has been happening for several days and I'm finally getting around to reproduction with the Console app and logs. I have 16 records on my device locally that each one gets this error back. FB16547732 - CloudKit: CKModifyRecordsOperation saving new records results in Error <CKError 0x3018ac1e0: "Internal Error" (1/3001); "MMCSEngineCreate failed">
2
0
582
Feb ’25
CloudKit operations using publicDatabase queue unreliable
CloudKit CKOperations do not complete when on cellular. When they do its once in a blue moon.I schedule things with allow cellular, and have verified in settings that iCloud allows cellular access. When I add any operation to the public database it will not do anything until I flip my device to wifi. This isn't acceptable as it is taking advantage of the location queries and is an on the go application.Has anyone come up with a workaround? Other posts suggest that it is a reported buy but has been around for a while so I'm not entirely sure.Edit:I have unit tests setup to do everything not only my application. When I run my unit tests with wifi off, they fail (30 second timeout without callback). After running them a few times with wifi (passing) and then switching they all of a sudden work on cellular (4 for 4 runs).I was able to run the app immediately after the successful cellular unit tests once. Its now back to failure.
6
0
1.8k
Apr ’21
HKMetadataKeyWeatherHumidity quantity unit incorrect
I'm adding Weather info to my workout app. The documentation for HKMetadataKeyWeatherHumidity states that the unit is percentage humidity. https://developer.apple.com/documentation/healthkit/hkmetadatakeyweatherhumidity HKUnit.percent() has valid values from 0.0-1.0 inclusive. https://developer.apple.com/documentation/healthkit/hkunit/1615517-percent For a given humidity of 61% (i.e. 0.61 from my server), I'm saving the following quantity: metadata[HKMetadataKeyWeatherHumidity] = HKQuantity(unit: .percent(), doubleValue: humidity) builder.addMetadata(metadata) { } The health app is interpreting this at 1% humidity (school kid rounding) 0.61 -- 1% and 0.41 -- 0%. When I print the humidity quantity of a workout recorded by Fitness app on Apple Watch, I see the value as 6100 %. Meanwhile, quantity.doubleValue(for: .percent()) prints out 61.0. Seems that the Health app is scaling by a factor of 100. Has anyone else integrated humidity into their HealthKit compatible app? How were you saving it to make sure it displayed correctly in the Health app. I'd hate to account for this, only to find out it is a bug and have apple change their logic in the app.
0
0
704
Apr ’21
I have found NullIsland - Simulator
Has anyone else discovered CoreLocations "NullIsland" print out? I recently came across this easter-egg-esque message printed from my CLLocationManager in simulator and device (iOS 14.4.2) in some of my workout API code. 2021-04-10 08:30:11.547947-0500 AppName[28506:1222419] [Client] {"msg":"#NullIsland Either the latitude or longitude was exactly 0! That's highly unlikely", "latIsZero":0, "lonIsZero":0} I was banking on CLLocationManagers caching/sharing the 'location' property and cheating a little not passing my 'lastLocation' data point from one area of code to another and just doing CLLocationManager().location. Oddly enough, when I am attached with a debugger and then PRINT that object via lldb po location, it is populated with non-zero lat/long. I could refactor my code to pass the location property throughout my code, but if the value isn't really NullIsland, I'm not sure if it is worth the trouble. Anyways, this message feels misleading because lat/log is non-zero. I would expect this message to be printed when returning NullIsland OR when returning nil itself. Here is the gist - https://gist.github.com/edorphy/930dfbe73d4c471d4cd7a9668048b760
1
0
1.6k
Apr ’21
NSPinnedDomains in AppClip Info.plist doesn't seem to take for URLSession API
I submitted a feedback asking what would be safe prevent MITM attacks against CloudKit web APIs, pinning against the CA was an okay'd implementation. This is the response I got in my feedback: FB9445034 You can pin to the various Apple CA or sub-CA certificates that can be found here: https://www.apple.com/certificateauthority/public/ https://www.apple.com/certificateauthority/ All the certificates for CloudKit and iCloud web APIs have cert chains that point to the certificates listed. I have followed this article Identity Pinning and modified my App Clip info.plist accordingly to pin against CloudKit Web Services (https://api.apple-cloudkit.com). I intentionally mucked up the identity pin to verify my URLSession requests failed. I didn't receive any URLSession errors in my App Clip or Application targets when I had the plist updates in both. In reading these other forum posts I'm curious if the Identity Pinning is supported in App Clips or not. https://developer.apple.com/forums/thread/678081 https://developer.apple.com/forums/thread/681734
1
0
1.7k
Jan ’22