Post

Replies

Boosts

Views

Activity

Is ASWebAuthenticationSession compatible with App Clips?
Question: Do App Clips support receiving callbacks from ASWebAuthentictionSession's redirectCallbackURL? Context: I'm trying to get CloudKit working in an app clip. Read support is done, but it would be nice for the user to see the capabilities before full download. Presently, I have the CloudKit Web Services successfully invoking redirectURL within SafariViewController, but I haven't figured out how to get it to direct to something the App Clip can get a hold of. CloudKit allows you to specify three different callbackURLs: https:// [freeform] http:// localhost[freeform] cloudkit-icloud.:// [freeform] I am new to AuthenticationSerivces framework so I may have missed something. The desired OAuth doesn't need to be CloudKit/iCloud but any provider. Everything is working except the redirect URL.
2
0
1k
Dec ’21
Does CloudKit support query predicate for reference field != nil?
I have a record type called ContactInformation that has phone and email as fields. This record type also has two references that point to different types. Namely type1 and type2 for illustration (one is a person reference, another is a place reference). When I seed my application I do a blind query operation to get all records. I don't think there is a way to perform a query using a predicate where the field isn't nil but thought I'd pose the question to the forums. The idea would be query where type1 != nil and then a second one where type2 != nil. Using CloudKit Console doesn't receive any results when running the following queries so I don't think this is supported as of today. CloudKit Console provides the following error when a reference filter by is applied with empty value: invalid id string: empty As a work around, I could create a 'dummy/default' reference id then the != "dummy identifier" would in theory work but it feels very hacky. Has anyone found a more elegant solution than to use a dummy reference ID? I filed this feedback requesting the ability to create a predicate that supports nil values: FB9833175
0
0
692
Jan ’22
App Privacy: Should I disclose Contact usage if using CloudKit's discover user identity feature?
Hey developer community / CloudKit fans, I'm making an application that utilizes CloudKit's identity system to provide my users a 'social' aspect of the app as well as their own identity. When filling out my App Privacy label, I'm torn if I should disclose Contact usage or not. https://developer.apple.com/documentation/cloudkit/ckcontainer/1640421-discoverallidentities Right now, I'm leaning to not specifying Contacts collection. Here are my thoughts: Data Collection defined by Apple, paraphrased, is transmitting data off device for longer than needed for the request. How Apple implements the function of the CloudKit identity lookup is outside of our control as developers, however, it is reasonable to expect that Apple would not save your contact address book in CloudKit and the data does not live in CloudKit longer than it needs to. I don't access the Contacts app or API in the implementation. Apple in fact use your contacts under the hood to service this request according to the documentation, however to the user, there is no contacts permission / access prompt for the application itself. The app doesn't get access to the full contacts db. When you receive a CKUserIdentity, the contacts identifier is just that, a lookup identifier string. I'm not going further than just displaying the information on the user identity. I could back link the identifier to a contacts record, but I don't need to. If I did that, even then I would say no, because the operation all happens locally on device. Does your app use CKUserIdentities? How did you answer the App Privacy question for Contacts? If you have strong feelings one way or another, I'd love to hear your perspective.
2
0
1.3k
Apr ’22
WKInterfaceController page layout init and awake are not called until user swipes pages
I've noticed a bug in my app recently, it appears that in watchOS 8.5 (or earlier) that page layout is no longer initializing or awakingWithContext the pages beyond the first index. According to the documentation: In a page-based interface, all interface controllers are initialized up front but only the first one is displayed initially. https://developer.apple.com/documentation/watchkit/wkinterfacecontroller/1619521-init I am simply not seeing this happen anymore. I have logging in all of the lifecycle method of all three of my pages and the second and third controllers don't fire anything (including init) until I swipe to the right. This is when I would expect the willActivate and didActivate methods to be invoked. Instead I get init, awake, willActivate, and then didActivate. :/ This is unfortunate and a bug to the user because the second controller asks to becomeCurrent under some certain conditions that the first detects and fires via NotificationCenter. The automatic programatic switching between pages is totally broken. FB9972047
1
0
1k
Apr ’22
CKNotification on watchOS fails to compile because compiler thinks non-optional but it really is
Xcode 14 beta 1 is yelling at me that CKNotification initializer should return a non-optional value. This happens only AFTER letting Xcode upgrade my project settings. The change that the upgrade project settings made was it merged my WatchKit and WatchKit extension targets into a single watch app target. After doing so, this code will not compile which I know to be good. // This line fails to compile with ' if let notification = CKNotification(fromRemoteNotificationDictionary: userInfo) { // Do something } Compile error: "Initializer for conditional binding must have Optional type, not 'CKNotification'" Feedback w/ sysdiagnose: FB10282805 - watchOS / CloudKit: CKNotification doesn't return optional, xcode build failing after updating project settings for Xcode 14 I could not reproduce this in a sample application. I tried making a standalone watch app with Xcode 13, upgrading the project file with Xcode 14 beta, and then creating a CKNotification object--but that worked fine. :/
0
0
849
Jun ’22
Builds from Xcode 14 RC are missing app clip domain status value in App Store Connect
Note: My app is in pre-order status for a version approved against Xcode 13.4.1, the below is for submitting an update with iOS/iPadOS 16 support using Xcode 14 RC released today. Is this happening for anyone else? I just downloaded Xcode 14 RC and archived/uploaded a build. When I select the build in App Store Connect to submit to review, it isn't showing my App Clip domains. When I select a build that was created yesterday with Xcode 14 Beta 6 from Xcode Cloud, the domains show, but for obvious reasons (Xcode beta tools) I cannot submit that build. I'm waiting for Xcode Cloud to add RC to their list and try again, but I'm stuck. I think it is just an App Store Connect issue, because my code is literally unchanged between these two builds less the build version. Furthermore, I inspected the archive locally from Xcode 14 RC and in the validation step, confirmed the entitlement lists my two appclips associated domains in both the app target and app clip target. I created a feedback for this here: FB11471066, FB11335182 Has anyone else had this issue? I know that App Clips was having some issues a few weeks ago but this seems like something entirely different: https://developer.apple.com/forums/thread/712372 Finally, to the last of my ability to troubleshoot, running the Diagnostics under App Clips Testing in the Settings app, I get all green checkmarks for both of my domains--so I really just believe this to be a portal issue and that everything actually checks out.
1
0
2.1k
Dec ’22
Core Location invoking visit callback with dozens of previously delivered visits from the past
I've been getting duplicate visits sent to my CLLocationManagerDelegate. This is new since iOS 16, I did not see this behavior in iOS 15--the observed effect is a quite severe regression in the behavior of CoreLocation. Here is what I'm seeing: The visits have already been delivered When they're sent 'again', they're sent in dozens of callbacks When they're sent 'again', they're sent in batches irrespective of app state I have had a debug app on my phone running since November to capture sysdiagnose for FB12107066. My app simply records data from CoreLocation into a mini Core Data table. Since November 11th, I have had 3808 visits, but when I do some distinct queries on arrival and departure I get a fraction of that. Select distinct arrivalDate: 929 Select distinct departureDate: 799 Select distinct arrivalDate + departureDate: 1172 I wrote some logic to attempt to deduplicate and filter out garbage visits that have already been delivered to me, but my filtering isn't bullet proof. This issue has been happening for me on multiple devices since Nov (iOS 16.2 days?). This happens on an iPhone 13 Pro and an iPad Pro 11-inch (4th gen). This is a real nasty bug as it also keeps waking my app up in the background when I don't expect it to since the OS is delivering me old / replay visits. :/ Has anyone else seen issue with the Core Location Visit API in iOS 16? What deduplication and filtering logic did you come up with? While the issue is affecting me via CoreLocation, I would suspect the same might also occur for anyone using the visits API in SensorKit too.
0
0
967
May ’23
Decoding crash report IPS metadata JSON keys
I've recently started working with IPS files, specifically crash reports. According to the documentation there are a number of metadata keys included in these payloads, however, I have found a number that are present in real ips files from device but are not documented. Does anyone know what version of iOS these 'new' metadata keys were introduced? How about if they're expected or if I should treat them as optional. https://developer.apple.com/documentation/xcode/interpreting-the-json-format-of-a-crash-report#IPS-metadata { "app_name":"ApplicationNameHere", "timestamp":"2024-02-15 08:05:05.00 -0600", "app_version":"1.6.0", "slice_uuid":"6b1f9f4e-3025-364f-9847-914fc1fe14d1", "build_version":"800", "platform":2, "bundleID":"reverse.domainname.bundleidentifier", "share_with_app_devs":1, "is_first_party":0, "bug_type":"309", "os_version":"iPhone OS 17.3.1 (21D61)", "roots_installed":0, "name":"ApplicationNameHere", "incident_id":"1CF0B8A1-EB43-46B3-AA9F-CFA8A9259190" } The following keys are not in the documentation: app_name, os_version, slice_uuid, share_with_app_devs, is_first_party, roots_installed I created this feedback to request the documentation be updated with current state. FB13631161 - Developer Documentation: Update IPS metadata to reflect latest values found in IPS Metadata JSON
1
0
3.3k
Feb ’24
Unable to view artifacts from Xcode Cloud build in Xcode - getting 501 error message
I'm trying to download artifacts from some recent Xcode Cloud builds. In both Xcode and App Store Connect I'm getting errors. Xcode says: "Error Fetching Test Results: API Invalid status code: 501. App Store Connect says: "artifacts could not be found." FB13773789 - Xcode Cloud: Service returning 501 in Xcode when trying to view artifacts of successful build from minutes ago I have tried several projects to rule out project specific issues and it is happening to all of my Xcode Cloud enabled projects. Both Xcode 15.3 and 15.4 beta exhibit this behavior. Is anyone else running into this issue? I noticed it yesterday, and it continues into this morning.
0
0
757
May ’24
SwiftUI SortDescriptor with optional chaining key-path will not archive using Xcode 16 beta 4
I'm running into an error in Xcode 16 beta 4 where the compiler can't type check what appears to be a simple @FetchRequest. I have the following Core Data types: Establishment name website etc. locations (relationship, to many, optional) Location name address establishment (relationship, to one, non-optional) In one of my SwiftUI views I have the following @FetchRequest and SortDescriptors. Unwrap required because 'core data' optional types. It looks based on the swift lang key-path expression docs that this should be allowed. Build and run works, but archiving does not. https://docs.swift.org/swift-book/documentation/the-swift-programming-language/expressions/#Key-Path-Expression In practice it won't be nil and validation should prevent it too so I could force unwrap the relationship property, but, defensive coding I want to make it safe as I can. @FetchRequest( sortDescriptors: [ SortDescriptor(\Location.establishment?.name, order: .forward), SortDescriptor(\Location.city, order: .forward), SortDescriptor(\Location.state, order: .forward) ] ) private var locations: FetchedResults<Location> This worked fine with Xcode 15.x, but fails to archive in Xcode 16 beta 4. The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions When I remove the first sort descriptor it works. When I force unwrap the optional key path property it works. Does anyone know of a documented change that would make this no longer work? FB14515958 - SwiftUI: SortDescriptor cannot archive in Xcode 16 beta 4 but works in Xcode 15.4 For clarity, this archives fine, note the force unwrap. @FetchRequest( sortDescriptors: [ SortDescriptor(\CraftTaproom.brewery!.name, order: .forward), SortDescriptor(\CraftTaproom.city, order: .forward), SortDescriptor(\CraftTaproom.state, order: .forward) ] ) private var taprooms: FetchedResults<CraftTaproom>
0
0
630
Jul ’24
What is the correct way to modify a SceneStorage variable from an AppIntent to one scene only for iPad SplitView mode
Apple's sample code 'Trails' supports multiple scenes, however everything is using shared state across the scenes. Put the app in Split View mode and have two windows of the app running and navigate, you can see both mirror each other. Works as designed, it is using a shared 'navigation model' across all scenes. https://developer.apple.com/documentation/appintents/acceleratingappinteractionswithappintents I would like to know if there is a supported or recommended way to modify individual scene storage from within the perform body of an AppIntent. The objective is to have App Shortcuts that launch different tabs in a TabView or different selections in a List. In short, I want to deep link to features, but account for more than one scene being open on iPad and only have programatic navigation happen on the scene that is 'foremost' or the 'activated' one in Split View. I have it working with either a @Dependency or posting a Notification with my main ContentView listening to the other end, but it changes all scenes.
0
0
686
Aug ’24
Workouts, activity rings, samples and more not syncing across devices running iOS 18 RC and watchOS 11 RC
I noticed last night that workouts I have been recording on my main carry device running 17.6.x have not been syncing to my beta devices running iOS 18 RC, iPadOS 18 RC and watchOS 11 RC. All devices are using the same Apple Account and I have iCloud enabled for Health data. The iPad running the RC has the syncing enabled in Profile. Is anyone else experiencing health data not propagating to the 18.x devices? Some of data exists on all devices but not all. For good measure I left the device unlocked on the health app last night for a long period of time to let it do its thing. This morning the data still hadn't propagated. I disabled and reenabled the synchronization on my iPad having chosen to delete all samples when disabling it. Hopefully all of my data dating back to the first Apple Watch in 2014 restores. FWIW my data set according to iCloud settings my health dataset is just shy of 650 MB. FB15102443 - Health / HealthKit: Workouts, activity rings, sample data, and more not syncing via iCloud to 18 RC device
0
0
615
Sep ’24
HealthKit bugs related to new workout effort score - heart rate samples take forever to fetch, Health app displays invalid data
I am encountering issues on my device running iOS 18 that fetching heart rate samples associated to a given workout is very slow. Like 10+ seconds slow. This is unacceptable and unexpected. In producing a video to attach to a feedback, I also observed that Apple Health app displays incorrect information if a workout effort score is associated to a workout. In this image, you can see the Health app bug: Total Resting Energy != Estimated Workout Effort Score Here is the same workout after I delete the workout effort score using the Apple Health app: Can anyone else see if attempting to view 'heart rate' data within the workout summary in Apple Health is unbearably slow if that workout also has an effort score associated? My steps: Record workout (Apple Activity app on watchOS) Associate effort score View the workout on Apple Health (iOS) Attempt to view it's heart rate samples Observe very slow loading times Observe the incorrect cell label and value and disappearance of resting energy cell data Remove/disassociate the effort score from the workout by tapping the workout effort row, and swipe to delete the value. Navigate back, navigate back, and then go into the workout detail again At this time the UI fixes itself, but the loading of heart rate data is still super slow FB15269657 - HealthKit: Sample query to fetch heart rate samples associated to a workout is taking over 10 seconds - computing 'time in heart rate zone' FB15278790 - Health: Workout summary 'Total Resting Energy' label has value of 'Estimated Workout Effort Score' for a value, pushed view shows empty
0
0
662
Sep ’24
CloudKit production index not being applied to existing records
I created a new index on two record types on Oct 12th. I still cannot query the records using the new queryable index on records that were created before that date. There is no indication in the schema history that the reindexing has started, completed, failed, or still in progress. What is the expectation for new indices being applied to existing records? Well over a week seems unacceptable for a database that has maybe 5000 records across a few record types. When I query my data using an old index and an old record field, I get hundreds of matching results so I know the data is there. FB15554144 - CloudKit / CloudKit Console: PRODUCTION ISSUE - Query against index created two weeks ago not returning all data as expected
1
0
518
Nov ’24
HealthKit - HKWorkoutRouteBuilder never returns from insert when created from newly added iOS HKLiveWorkoutBuilder API on Simulator
Has anyone had success using the HKWorkoutRouteBuilder in conjunction with the new iOS support for HKLiveWorkoutBuilder? I was running my watchOS code that worked now brought over to iOS and when I call insertRouteData the function never returns. This happens for both the legacy and closure based block patterns. private var workoutSession: HKWorkoutSession? private var workoutBuilder: HKLiveWorkoutBuilder? private var serviceSession: CLServiceSession? private var workoutRouteBuilder: HKWorkoutRouteBuilder? private func startRouteBuilder() { Task { @MainActor in self.serviceSession = CLServiceSession(authorization: .whenInUse) self.workoutRouteBuilder = self.workoutBuilder?.seriesBuilder(for: .workoutRoute()) as? HKWorkoutRouteBuilder self.locationUpdateTask = Task { do { for try await update in CLLocationUpdate.liveUpdates(.fitness) { if let location = update.location { self.logger.notice(#function, metadata: [ "location": .stringConvertible(location) ]) try await self.workoutRouteBuilder?.insertRouteData([location]) self.logger.notice("Added location") } } } catch { self.logger.error(#function, metadata: [ "error": .stringConvertible(error.localizedDescription) ]) } } } } I did also try CLLocationManager API with delegate which is what my current watch code uses (a bit old). Same issue. Here is what I've found so far: If the workout session is not running, and if the builder hasn't started collection yet, inserting route data works just fine I've tried different swift language modes, flipped from main actor to non isolated project settings (Xcode 26) Modified Apple's sample code and added location route building to that and reproduced the error, modified sample attached to feedback This issue was identified against Xcode 26 beta 2 and iPhone 16 Pro simulator. Works as expected on my iPhone 13 Pro beta 2. FB18603581 - HealthKit: HKWorkoutRouteBuilder insert call within CLLocationUpdate task never returns
0
0
173
Jul ’25