Hey All, I am having trouble deploying my subscriptions to "Production". My subscription shows up in "Development", but I cannot get my remote notifications to deploy to "Production" to work in TestFlight. I followed the Swiftful Thinking tutorial and this part was not covered. Any tips? Thanks!
Post
Replies
Boosts
Views
Activity
Hey All, I have a Reference (List) property in my CloudKit record type that points to a variety of locations. When I fetch the record with the reference (List), how do I then fetch the locations that the reference (List) is pointing to? Thanks!
Here is my
`code: func getLocationsWhereVendorIsSelling() {
// Retrieve Profile Record ID
guard let profileRecordID = CloudKitManager.shared.profileRecordID else { return }
CloudKitManager.shared.fetchRecord(with: profileRecordID) { result in
switch result {
// Get profile record
case .success(let record):
// Location References in profile
let locationReferences = record[MLProfile.kIsSellingAt] as? [CKRecord.Reference]
// Get all locations
let locations = self.locationManager.locations
// Filter locations by the ones that have the reference
let predicate = NSPredicate(format: "%K CONTAINS %@", locationReferences!, locations)
// Add locations to the soldToLocations array
let query = CKQuery(recordType: RecordType.location, predicate: predicate)
CKContainer.default().publicCloudDatabase.perform(query, inZoneWith: nil) {
locationRecords, error in
guard let locationRecords = locationRecords, error == nil else {
print(error!.localizedDescription)
return
}
print(locationRecords)
}
case .failure(_):
print("Error getting all the locations")
}
}
}`