CloudKit JS

RSS for tag

CloudKit JS provides access from your web app to your CloudKit app’s containers and databases.

Posts under CloudKit JS tag

26 Posts

Post

Replies

Boosts

Views

Activity

CloudKit JS PWA
Hi, has anyone seen an example of Progressive Web App (PWA) using cloudkit js? I am exploring that avenue for multiplatform support of an existing SwiftUI app using CoreData and CloudKit. I see that this cloudkit.js demo uses vercel https://cloudkitjs.vercel.app/ so perhaps something based on next.js would be a natural progression here, but I don't really have a preference for one of the many frameworks out there (pwabuilder, angular, react, vue, next, and the list goes on and on) Thanks
1
0
1.3k
Jun ’22
Streaming audio stored in CloudKit
Short version: Is it a terrible hack to use the URLs to remote CKAsset? And are they permanent? I'm building an app that plays sound using AV(Queueu)Player and use CloudKit with CoreData to store the metadata. I was planning to also store the audio assets there, as CKAssets, but it seems like it's not really built for this use case, at least if I want to avoid downloading the files first. What I mean is, AVPlayer plays audio from URLs, but CloudKit doesn't provide a simple way to get the URL for a remote asset, so it would seem I have to first sync the assets down to the local disk, which is what I want to avoid, I would prefer to stream them. There is a way to get the URL, but only using CloudKit JS APIs, as described in [1], but is that a hacky workaround or something we can rely on? And are these URLs permanent? Finally, silly question perhaps, but even if the URLs are solid, can I safely stream audio from them? [1] https://stackoverflow.com/questions/35104247/obtaining-ckasset-url-without-downloading-data
0
0
1.5k
May ’22
How long does a downloadURL of an asset persist?
https://developer.apple.com/documentation/cloudkitjs/cloudkit/database/1628735-saverecords mentions that we can use the downloadURL to provide a link to the user, however it seems this URL will expire after some time, and it will return 410 GONE as http status code when it expires. How long does the link persist before it expires, is it documented anywhere?
1
0
1.3k
Jan ’22
CoreData
Hi All, I'm very new to iOS app development. I've managed to complete the Scrumdinger tutorial. However, I would like to know how can I use CoreData or CloudKit to persist the data. URL: https://developer.apple.com/tutorials/app-dev-training/persisting-data I'm having trouble to bind the data to EditView(). Is there any online guide or tutorial that can help me? Thank you!
2
0
1.5k
Aug ’21
Unable to populate value from CloudKit onto my display
Hello everyone! I am pretty new to SwiftUI and have been trying to figure out a solution to the issue below for about a week. I can successfully save values in CloudKit, and can load them within the operation.recordFetchedBlock block using print(String(ping.value)) on line 15. However, I can not figure out a way to actually load them on the display within ContentView: View For some reason I continue to get the following (empty array) in the output when using print(loadPing()) on line 9: [] No Error Found Below is the code: struct ContentView: View {     @StateObject var progress = UserProgress()     var body: some View{         VStack{             Button("Submit") {                 progress.ping += 1                 sendItem(counter: progress.ping)                 print(loadPing())             }             Text("Ping Count \(progress.ping)")         }     } } class Ping: NSObject {     let id = UUID()     var recordID: CKRecord.ID!     var name: String!     var value: String! } loadPing() -> [Ping]{     var newPing = [Ping]()     let ping = Ping()     let query = CKQuery(recordType: "PingTest", predicate: NSPredicate(value: true))     let operation = CKQueryOperation(query: query)     operation.desiredKeys = ["value", "name"]     operation.recordFetchedBlock = { record in         ping.recordID = record.recordID         ping.name = record["name"]         ping.value = record["value"]         newPing.append(ping) //        print(String(ping.value))     }     operation.queryCompletionBlock = {(cursor, error) in             DispatchQueue.main.async {                 if error == nil {                     print("No Error Found")                 } else {                     print("Error was Found")                     print(error!.localizedDescription)                 }             }         }      CKContainer.default().publicCloudDatabase.add(operation)     return newPing } I would be very grateful if someone could help me figure out a way to populate the actual values from CloudKit onto my display in the ContentView. I have sifted through various tutorials but nothing has worked so far.
3
0
1.2k
Jul ’21
CloudKit JS PWA
Hi, has anyone seen an example of Progressive Web App (PWA) using cloudkit js? I am exploring that avenue for multiplatform support of an existing SwiftUI app using CoreData and CloudKit. I see that this cloudkit.js demo uses vercel https://cloudkitjs.vercel.app/ so perhaps something based on next.js would be a natural progression here, but I don't really have a preference for one of the many frameworks out there (pwabuilder, angular, react, vue, next, and the list goes on and on) Thanks
Replies
1
Boosts
0
Views
1.3k
Activity
Jun ’22
Streaming audio stored in CloudKit
Short version: Is it a terrible hack to use the URLs to remote CKAsset? And are they permanent? I'm building an app that plays sound using AV(Queueu)Player and use CloudKit with CoreData to store the metadata. I was planning to also store the audio assets there, as CKAssets, but it seems like it's not really built for this use case, at least if I want to avoid downloading the files first. What I mean is, AVPlayer plays audio from URLs, but CloudKit doesn't provide a simple way to get the URL for a remote asset, so it would seem I have to first sync the assets down to the local disk, which is what I want to avoid, I would prefer to stream them. There is a way to get the URL, but only using CloudKit JS APIs, as described in [1], but is that a hacky workaround or something we can rely on? And are these URLs permanent? Finally, silly question perhaps, but even if the URLs are solid, can I safely stream audio from them? [1] https://stackoverflow.com/questions/35104247/obtaining-ckasset-url-without-downloading-data
Replies
0
Boosts
0
Views
1.5k
Activity
May ’22
Will CloudKit’s encrypted fields work with CloudKit JS?
Does the new encrypted fields work with CloudKit JS? I have checked the API for CloudKit JS, and under CloudKit.Record there is no mentioning of encrypted fields. It feels like this API has not been updated for a while. Does this mean that if I use field-level encryption, I will not be able to use CloudKit JS?
Replies
2
Boosts
0
Views
1.4k
Activity
May ’22
How long does a downloadURL of an asset persist?
https://developer.apple.com/documentation/cloudkitjs/cloudkit/database/1628735-saverecords mentions that we can use the downloadURL to provide a link to the user, however it seems this URL will expire after some time, and it will return 410 GONE as http status code when it expires. How long does the link persist before it expires, is it documented anywhere?
Replies
1
Boosts
0
Views
1.3k
Activity
Jan ’22
CoreData
Hi All, I'm very new to iOS app development. I've managed to complete the Scrumdinger tutorial. However, I would like to know how can I use CoreData or CloudKit to persist the data. URL: https://developer.apple.com/tutorials/app-dev-training/persisting-data I'm having trouble to bind the data to EditView(). Is there any online guide or tutorial that can help me? Thank you!
Replies
2
Boosts
0
Views
1.5k
Activity
Aug ’21
Unable to populate value from CloudKit onto my display
Hello everyone! I am pretty new to SwiftUI and have been trying to figure out a solution to the issue below for about a week. I can successfully save values in CloudKit, and can load them within the operation.recordFetchedBlock block using print(String(ping.value)) on line 15. However, I can not figure out a way to actually load them on the display within ContentView: View For some reason I continue to get the following (empty array) in the output when using print(loadPing()) on line 9: [] No Error Found Below is the code: struct ContentView: View {     @StateObject var progress = UserProgress()     var body: some View{         VStack{             Button("Submit") {                 progress.ping += 1                 sendItem(counter: progress.ping)                 print(loadPing())             }             Text("Ping Count \(progress.ping)")         }     } } class Ping: NSObject {     let id = UUID()     var recordID: CKRecord.ID!     var name: String!     var value: String! } loadPing() -> [Ping]{     var newPing = [Ping]()     let ping = Ping()     let query = CKQuery(recordType: "PingTest", predicate: NSPredicate(value: true))     let operation = CKQueryOperation(query: query)     operation.desiredKeys = ["value", "name"]     operation.recordFetchedBlock = { record in         ping.recordID = record.recordID         ping.name = record["name"]         ping.value = record["value"]         newPing.append(ping) //        print(String(ping.value))     }     operation.queryCompletionBlock = {(cursor, error) in             DispatchQueue.main.async {                 if error == nil {                     print("No Error Found")                 } else {                     print("Error was Found")                     print(error!.localizedDescription)                 }             }         }      CKContainer.default().publicCloudDatabase.add(operation)     return newPing } I would be very grateful if someone could help me figure out a way to populate the actual values from CloudKit onto my display in the ContentView. I have sifted through various tutorials but nothing has worked so far.
Replies
3
Boosts
0
Views
1.2k
Activity
Jul ’21