Post

Replies

Boosts

Views

Activity

Cursor in CloudKit does not work. Where is mistake?
I’m trying to make cursor the right way. But it doesn’t work. If I set limit 5, then I can see only 5 records, even I move my finger on the map (I’m using MapKit with CloudKit). If 200 then 200, but have to wait for very long time. I’m sure my cursor is wrong. Who can help me? func getLocation(completed: @escaping (Result<[AppLocation], Error>) -> Void) {      let sortDescriptor = NSSortDescriptor(key: AppLocation.kName, ascending: true)      let query = CKQuery(recordType: RecordType.location, predicate: NSPredicate(value: true))      query.sortDescriptors = [sortDescriptor]      let operation = CKQueryOperation(query: query)      operation.resultsLimit = 5      operation.query = query      operation.queuePriority = .veryHigh      operation.qualityOfService = .userInteractive      var locations = [AppLocation]()            operation.recordFetchedBlock = { record in        let location = AppLocation(record: record)        locations.append(location)      }      operation.queryCompletionBlock = { (cursor, error) in        DispatchQueue.main.async {          if let error = error {            completed(.failure(error))          } else {            completed(.success(locations))          }        }      }      CKContainer.default().publicCloudDatabase.add(operation) }
2
0
867
Dec ’21
Can see App Clips banner only when app is installed
I can see App Clips banner only when app is installed. But see nothing when isn't installed. My .well-known/apple-app-site-association file: &#9;"applinks": { &#9;&#9;&#9;"apps": [], &#9;&#9;&#9;"details": [ &#9;&#9;&#9;&#9;&#9; { &#9;&#9;&#9;&#9;&#9;&#9; "appID":&#9;"ABCDEFG.com.mywebsite.MYAPP", &#9;&#9;&#9;&#9;&#9;&#9; "components": [ &#9;&#9;&#9;&#9;&#9;&#9;&#9; { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;"/": "/abc", &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;"comment": "Matches any URL" &#9;&#9;&#9;&#9;&#9;&#9;&#9; } &#9;&#9;&#9;&#9;&#9;&#9;&#9; ] &#9;&#9;&#9;&#9;&#9; } &#9;&#9;&#9; ] &#9; }, &#9; "webcredentials": { &#9;&#9;&#9;"apps": [ "ABCDEFG.com.mywebsite.MYAPP" ] &#9; }, &#9;&#9;"appclips": { &#9;&#9;&#9;&#9;"apps": ["ABCDEFG.com.mywebsite.MYAPP.Clip"] &#9;&#9;} } Associated Domains in the app target and App Clips target are the same: webcredentials, applinks and appclips with my domain. On the App Store Connect domain Validated and Advanced App Clip Experiences is created. Banner on the website: <meta name="apple-itunes-app" content="app-id=1234567890, app-clip-bundle-id=com.mywebsite.MYAPP.Clip"> Where can be a problem?
2
0
726
Dec ’21
See nothing when I use CloudKit cursor. Where is a problem?
I am using the CloudKit cursor in my app and the cursor works because I can see it from the print (cursor code: https://controlc.com/0d42933b). However, I see nothing on the map (I am using MapKit, CloudKit, and SwiftUI in my project). Below is my View Model: … func fetchLocations() {         ckController.database.fetchRecords(with: RecordType.location) { (results, moreComing, error) in             print("fetchRecords: results.count = \(results.count), moreComing = \(moreComing), error = \(String(describing: error))")             if !moreComing {                 DispatchQueue.main.async { [self] in                     objects = results                                     }             }         }  } … Below is my implementation in the view: … .task {      if locationManager.locations.isEmpty {         viewModel.fetchLocations()      }  } … Print (I have 155 records): fetchRecords: results.count = 1, moreComing = true, error = nil fetchRecords: results.count = 2, moreComing = true, error = nil … fetchRecords: results.count = 155, moreComing = true, error = nil fetchRecords: results.count = 155, moreComing = false, error = nil Somebody knows solutions? Where is a mistake and how I can see all my elements on the map finally?
2
0
749
Dec ’21
Cursor in CloudKit does not work. Where is mistake?
I’m trying to make cursor the right way. But it doesn’t work. If I set limit 5, then I can see only 5 records, even I move my finger on the map (I’m using MapKit with CloudKit). If 200 then 200, but have to wait for very long time. I’m sure my cursor is wrong. Who can help me? func getLocation(completed: @escaping (Result<[AppLocation], Error>) -> Void) {      let sortDescriptor = NSSortDescriptor(key: AppLocation.kName, ascending: true)      let query = CKQuery(recordType: RecordType.location, predicate: NSPredicate(value: true))      query.sortDescriptors = [sortDescriptor]      let operation = CKQueryOperation(query: query)      operation.resultsLimit = 5      operation.query = query      operation.queuePriority = .veryHigh      operation.qualityOfService = .userInteractive      var locations = [AppLocation]()            operation.recordFetchedBlock = { record in        let location = AppLocation(record: record)        locations.append(location)      }      operation.queryCompletionBlock = { (cursor, error) in        DispatchQueue.main.async {          if let error = error {            completed(.failure(error))          } else {            completed(.success(locations))          }        }      }      CKContainer.default().publicCloudDatabase.add(operation) }
Replies
2
Boosts
0
Views
867
Activity
Dec ’21
Can see App Clips banner only when app is installed
I can see App Clips banner only when app is installed. But see nothing when isn't installed. My .well-known/apple-app-site-association file: &#9;"applinks": { &#9;&#9;&#9;"apps": [], &#9;&#9;&#9;"details": [ &#9;&#9;&#9;&#9;&#9; { &#9;&#9;&#9;&#9;&#9;&#9; "appID":&#9;"ABCDEFG.com.mywebsite.MYAPP", &#9;&#9;&#9;&#9;&#9;&#9; "components": [ &#9;&#9;&#9;&#9;&#9;&#9;&#9; { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;"/": "/abc", &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;"comment": "Matches any URL" &#9;&#9;&#9;&#9;&#9;&#9;&#9; } &#9;&#9;&#9;&#9;&#9;&#9;&#9; ] &#9;&#9;&#9;&#9;&#9; } &#9;&#9;&#9; ] &#9; }, &#9; "webcredentials": { &#9;&#9;&#9;"apps": [ "ABCDEFG.com.mywebsite.MYAPP" ] &#9; }, &#9;&#9;"appclips": { &#9;&#9;&#9;&#9;"apps": ["ABCDEFG.com.mywebsite.MYAPP.Clip"] &#9;&#9;} } Associated Domains in the app target and App Clips target are the same: webcredentials, applinks and appclips with my domain. On the App Store Connect domain Validated and Advanced App Clip Experiences is created. Banner on the website: <meta name="apple-itunes-app" content="app-id=1234567890, app-clip-bundle-id=com.mywebsite.MYAPP.Clip"> Where can be a problem?
Replies
2
Boosts
0
Views
726
Activity
Dec ’21
See nothing when I use CloudKit cursor. Where is a problem?
I am using the CloudKit cursor in my app and the cursor works because I can see it from the print (cursor code: https://controlc.com/0d42933b). However, I see nothing on the map (I am using MapKit, CloudKit, and SwiftUI in my project). Below is my View Model: … func fetchLocations() {         ckController.database.fetchRecords(with: RecordType.location) { (results, moreComing, error) in             print("fetchRecords: results.count = \(results.count), moreComing = \(moreComing), error = \(String(describing: error))")             if !moreComing {                 DispatchQueue.main.async { [self] in                     objects = results                                     }             }         }  } … Below is my implementation in the view: … .task {      if locationManager.locations.isEmpty {         viewModel.fetchLocations()      }  } … Print (I have 155 records): fetchRecords: results.count = 1, moreComing = true, error = nil fetchRecords: results.count = 2, moreComing = true, error = nil … fetchRecords: results.count = 155, moreComing = true, error = nil fetchRecords: results.count = 155, moreComing = false, error = nil Somebody knows solutions? Where is a mistake and how I can see all my elements on the map finally?
Replies
2
Boosts
0
Views
749
Activity
Dec ’21
Possible convert [CKRecord] to [CKRecord.ID : Int]?
I have an error Cannot assign value of type '[CKRecord]' to type '[CKRecord.ID : Int]'. Is it possible to convert [CKRecord] to [CKRecord.ID : Int]?
Replies
5
Boosts
0
Views
820
Activity
Dec ’21
UDID for Apple TV for Provisioning Profile?
I am done with my tvOS app. But I don't have physical Apple TV. However, it is necessary if I want to distribute my app. Currently, Apple TV has already sold out in my country. Can anybody borrow the UDID of Apple TV? 😅
Replies
2
Boosts
0
Views
729
Activity
Dec ’21
touchesBegan for tvOS in the game?
I have a game with SpriteKit for iPhone, iPad and Mac. I am gonna make for Apple TV. But I take it override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { doesn't work for tvOS. Then what I am supposed to use to make my buttons selectable and I can press ones?
Replies
2
Boosts
0
Views
759
Activity
Dec ’21