Post not yet marked as solved
I am developing a Mac applicaiton (soon to be iOS as well) and I'm experimeting with CloudKit as an alternative to my existing database systems.I have noticed that all kinds of operations, queries, saves, updates, etc. all take around 30 seconds to perform:Is there something I have misconfigured?Is this normal?What am I doing wrong, or am I thinking of CloudKit in a different way than it is indented to be used?EDITUpon purchasing a new MacBook and running my application on the new device, I realized that the CloudKit latency problems only existed on my iMac, not the new computer. I am still not sure what is causing this (problem still exists on the iMac).
Post not yet marked as solved
I have tested some projects to use iCloud and there are some unused icloud containers left behind. Is there anyway to delete them? Thanks in advance.
Post not yet marked as solved
I am working on an app that I would like to release for both mac and iOS. I'd like to use iCloud Key Value storage to share small bits of data between the apps. Unfortunately, it appears that the iOS and mac apps are writing to different iCloud KVS container IDs.per https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW2> Configuring Key-Value Storage > Key-value storage allows an app to share small amounts of data with other instances of itself running on the user’s other devices. The container ID for key- value storage is iCloud.[$(TeamIdentifierPrefix)].[$(CFBundleIdentifier)] where the Team ID is a unique string assigned to your team. To enable key-value storage, select the “Key-value storage” checkbox. To learn how to use key-value storage for preferences, read iCloud Design Guide.So, assuming my team identifier is JaysTeam and my iOS app's CFBundleIdentifier is com.jay.sampleapp, then the container ID for my iOS app would be "JaysTeam.com.jay.sampleapp"Unfortunately, I cannot set the CFBundleIdentifier of both targets to the same value. So it appears that I cannot get both an iOS and a mac app to write to the same iCloud Key Value Storage container. Thus, I can't share info between an iOS and a Mac app via iCloud Key Value Storage.Am I missing something, or is this correct?
Post not yet marked as solved
Hi,I have 2 iOS apps with which I tested iCloud Drive.With the frst one I didn't had any trouble.I'm able to use the iCloud Drive and files that I store in the ubiquituos container are transferred to the cloudand I can see the Apps folder and contents in Finder on my iMac.Now the strange thing is that with the 2nd app I get problems although I have setup everything exactly the same.The only difference that I can see is that during the initial run of App2 with iCloud entitlements enabled I had forgottento add the <key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.***.app2</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>App2</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>in the info-plist file.I get the feeling that this screwed app the iCloud for this app and even if I now set this up correctly it refuses to work.Any one experiencing a similar issue?Or is there any way to reset the iCloud for an app completely and start over again?One more thing: when using brctl I can see that items are sent/retrieved from the iCloud and they are stored in theiCloud Drive folder on my Mac. But they are not visible in Finder.
Post not yet marked as solved
I recently bought an iPhone 6 plus off an app called 5 mile, the phone has an icloud activation lock on it i would like to is the a simple way to unlock the phone without the icloud password?
Post not yet marked as solved
Hi,I'm trying to use CloudKit Web Services to access my public database (development env.) I can read the records, when I try to use enpoint /records/modify I always get response that CREATE operation not permitted{
"records" : [
{
"serverErrorCode" : "ACCESS_DENIED",
"recordName" : "E99612AE-34A7-482E-876E-BE2F3D063397",
"reason" : "CREATE operation not permitted"
}
]
}I have Web Token obtained as described here (Authenticating Users): https://developer.apple.com/library/prerelease/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/SettingUpWebServices/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW1I already did try enable "everything" in "Security" of my "Record Type", didn't help. What should I do to make it work ? help, I'm totally stuck.
Post not yet marked as solved
I have a situation where a CloudKit record is not being returned by a query (and also doesn't appear in the CloudKit dashboard), but it exists when fetching it by it's ID.The record was added days ago, so it really should have been indexed.The record ID metadata index has always been set for the record type.The query I use is fetching all records for a particular record type in a custom zone.Strangely, when I search for the record in the dashboard and select it, the record name field is blank on the detail panel.It's very peculiar, and very concerning!Anyone have any ideas?
Post not yet marked as solved
Hi,I've got my CloudKit records with created and modifed setup to be sortable and queryable but I'm having a hard time constructing a CloudKit.js query that will use those values.This: var query = {
recordType: "MyRecord",
sortBy: [{
fieldName: 'created'
}]
};This doesn't work, I get this error:Unknown field 'CKFieldName{_name='created'}I also tried 'createdDate', 'modified', 'modificationDate' and all give the same error. What's the magic?
I'm struggling getting the signing part of sending server 2 sever requests working from .Net/c#I'm struggling to build the header X-Apple-CloudKit-Request-Signaturev1 Has anyone had any joy getting this working (I know announcement was only about 3 days ago):-)
Post not yet marked as solved
So I have been using iCloud in my app, just about from the launch of the iCloud API, many years back.I'm doing an update of my app now, and I noticed that my iCloud functionality is broken.Scanning for local documents, gives me a whole bunch of iCloud documents.Yet, if I want to open one, I find that the file is actually not there, according to NSFileManager./private/var/mobile/Library/Mobile%20Documents/APPID~com~steenriver~tlctc/Documents/ is where I used to load these documents from.But now, the files are no longer there, even though they were found in the NSDocumentDirectory.Did NSDocumentDirectory change sometime in the past?Tanks,BramPS: It pains me that I, as an early adopter, now get hit by this.
Post not yet marked as solved
For demo iCloud, build many containers in CloudKit Dashboard. Now i want to delete some old containers but i can't. I need help thanks.
Sometimes it takes a long time for iCloud to begin syncing. Is there code I can use to cause iCloud to begin syncing when I want it to?
Post not yet marked as solved
Is the CloudKit sharing support announced at WWDC16 actually supported in iOS 10? The documentation for CKShare, UICloudSharingController and friends is still (as of Sept 10, 2016) sparse to nonexistent.I haven't been able to find any overview of it other than the WWDC presentation, which lacks important details and doesn't quite match the API interfaces any more. The sample code released on Sept 7 says "Add a new Sharing tab with CloudKit Sharing examples (Big new feature for WWDC)." but I can't find anything in the code about it. Even a Google search for "ckshare" or "uicloudsharingcontroller" turn up nothing interesting. And I've tried to get it working on my own, but I've only been able to get a few simple cases to sort of work. I see that the iOS 10 Notes app works pretty well, so maybe it's working for some cases.Am I missing something? Has anyone else had any luck with it?
Post not yet marked as solved
Hi,Anyone experiencing the same? When downloading a large zone from the private database with a large number of changes, adds and deletes (say 20k records, 15k deletes and 5k changes) cloudd crashes reproducibly along the way. This only happens when fetchAllChanges=YES. When set to NO or when using the older CKFetchRecordChangesOperation, everything works as expected.Here are some stacks where cloudd is crashing:Thread 5 Crashed:: Dispatch queue: com.apple.cloudkit.fetchAllZoneChanges.callback.0x7fa2cde154500 com.apple.cloudkit.CloudKitDaemon 0x00007fffd2420004 CKDPQueryRetrieveRequestReadFrom + 5061 libdispatch.dylib 0x00007fffdcb41128 _dispatch_client_callout + 82 libdispatch.dylib 0x00007fffdcb578e8 _dispatch_queue_serial_drain + 2093 libdispatch.dylib 0x00007fffdcb49d41 _dispatch_queue_invoke + 10464 libdispatch.dylib 0x00007fffdcb579d2 _dispatch_queue_serial_drain + 4435 libdispatch.dylib 0x00007fffdcb49d41 _dispatch_queue_invoke + 10466 libdispatch.dylib 0x00007fffdcb579d2 _dispatch_queue_serial_drain + 4437 libdispatch.dylib 0x00007fffdcb49d41 _dispatch_queue_invoke + 10468 libdispatch.dylib 0x00007fffdcb42ee0 _dispatch_root_queue_drain + 4769 libdispatch.dylib 0x00007fffdcb42cb7 _dispatch_worker_thread3 + 9910 libsystem_pthread.dylib 0x00007fffdcd8d746 _pthread_wqthread + 129911 libsystem_pthread.dylib 0x00007fffdcd8d221 start_wqthread + 13Thread 5 Crashed:: Dispatch queue: com.apple.cloudkit.fetchAllZoneChanges.callback.0x7fbcb1575f200 libobjc.A.dylib 0x00007fffdc2938a4 objc_loadWeakRetained + 1661 com.apple.cloudkit.CloudKitDaemon 0x00007fffd24292b4 __82-[CKDFetchRecordZoneChangesOperation _handleRecordChange:perRequestSchedulerInfo:]_block_invoke_2 + 472 libdispatch.dylib 0x00007fffdcb56680 _dispatch_block_async_invoke_and_release + 753 libdispatch.dylib 0x00007fffdcb41128 _dispatch_client_callout + 84 libdispatch.dylib 0x00007fffdcb578e8 _dispatch_queue_serial_drain + 2095 libdispatch.dylib 0x00007fffdcb49d41 _dispatch_queue_invoke + 10466 libdispatch.dylib 0x00007fffdcb579d2 _dispatch_queue_serial_drain + 4437 libdispatch.dylib 0x00007fffdcb49d41 _dispatch_queue_invoke + 10468 libdispatch.dylib 0x00007fffdcb579d2 _dispatch_queue_serial_drain + 4439 libdispatch.dylib 0x00007fffdcb49d41 _dispatch_queue_invoke + 104610 libdispatch.dylib 0x00007fffdcb42ee0 _dispatch_root_queue_drain + 47611 libdispatch.dylib 0x00007fffdcb42cb7 _dispatch_worker_thread3 + 9912 libsystem_pthread.dylib 0x00007fffdcd8d746 _pthread_wqthread + 129913 libsystem_pthread.dylib 0x00007fffdcd8d221 start_wqthread + 13Thread 5 Crashed:: Dispatch queue: com.apple.cloudkit.fetchAllZoneChanges.callback.0x7faca45256300 com.apple.cloudkit.CloudKitDaemon 0x00007fff88fc0004 -[CKDPCSCacheRecordFetchOperation _decryptPCS] + 64661 libdispatch.dylib 0x00007fff936e7128 _dispatch_client_callout + 82 libdispatch.dylib 0x00007fff936fd8e8 _dispatch_queue_serial_drain + 2093 libdispatch.dylib 0x00007fff936efd41 _dispatch_queue_invoke + 10464 libdispatch.dylib 0x00007fff936fd9d2 _dispatch_queue_serial_drain + 4435 libdispatch.dylib 0x00007fff936efd41 _dispatch_queue_invoke + 10466 libdispatch.dylib 0x00007fff936fd9d2 _dispatch_queue_serial_drain + 4437 libdispatch.dylib 0x00007fff936efd41 _dispatch_queue_invoke + 10468 libdispatch.dylib 0x00007fff936e8ee0 _dispatch_root_queue_drain + 4769 libdispatch.dylib 0x00007fff936e8cb7 _dispatch_worker_thread3 + 9910 libsystem_pthread.dylib 0x00007fff93933746 _pthread_wqthread + 129911 libsystem_pthread.dylib 0x00007fff93933221 start_wqthread + 13Already filed a bug report, #28461661
Post not yet marked as solved
For some reason, a small subset of my users on iOS 10 are unable to read from my public iCloud container.The localisedError that CloudKit returns is "Account doesn't have access to CloudKit account", however after searching online, I can't find any mention of this error.Does anyone have any ideas what would cause this? They are signed into iCloud (I have asked a few to sign out/in again but this hasnt resolved), have iCloud Drive enabled and also "Use Mobile Data" enabled too in iCloud Drive settings. Example code sample below.let sortDescriptor = NSSortDescriptor.init(key: "Version", ascending: false)
let publicDatabase = CKContainer(identifier:"iCloud.blah.blah.blah").publicCloudDatabase
let truePredicate = NSPredicate(value: true)
let VersionQuery = CKQuery(recordType: "Version", predicate: truePredicate)
VersionQuery.sortDescriptors = [sortDescriptor]
publicDatabase.performQuery(VersionQuery, inZoneWithID: nil) { (record, error) -> Void in
print("Cloudkit Error = \(error?.localizedDescription)")
}
I am trying to build a web site that will offer some picture enhancement services. So far I have authentication working. There's a lot of documentation regarding finding records but as expected there is not much in my App's container. I need to access the user's private data in ICloud Photos. I suspect there's a container name for that but cannot find it anywhere. Is what I want to do possible or is it a closed system?If it's closed I'll have to put the user through the inconvenience of uploading pictures to my site so we can enhance them. If we can access their photos it'll be a much better experience for them.Our guess at this time is that there needs to be some permissions granted by the user during signon and we need to specify a different container name in the request uri, but it's only a guess.We rummaged around Cloudkit Dashboard to see if there is some way to ask for permissions that we missed but so far no joy.You can tell that we are new to CloudKit . Any help you can provide will be greatly appreciated.
Post not yet marked as solved
My Enviroinment:xcode 8.2.1Swift 3.0MacOS 10.12.3Maybe I misunderstand how iCloud Drive is designed to work. My iPhone app will create files and store them in the app's ubiquitous file folder so they should appear in the icloud drive on the mac or PC. However the files are not visible with the mac finder even though the files do exist in the mac filesystem. More on this later.Here is my code to create the file:let containerURL = FileManager.default.url(forUbiquityContainerIdentifier: nil)
let documentDirectoryURL = containerURL!.appendingPathComponent("Documents")
let documentURL = documentDirectoryURL.appendingPathComponent("myFile.txt")
let text = String("test message")
text.write(to: documentURL, atomically:true, encoding:String.Encoding.utf8)You can see I am using the app's default ubiquity container URL and appending the folder "Documents" and appending a filename. The app runs without any errors and I can confirm the file is created and viewable from the iCloud Drive app on the phone. In fact the iCloud Drive app on the iPhone will show me the correct folder name as I defined it with NSUbiquitousContainerName. I can also view this file on the Mac in a couple ways:1) Using the terminal program on the Mac I can see the file is created and updated correctly at this path: /Users/mjc/Library/Mobile Documents/iCloud~com~mchartier~motoproto1/Documents/myFile.txt2) Using the Mac Finder I can see the file when I click on "All My Files".However I do not see the file or the app's ubiquitous folder when I click on "iCloud Drive" on the Finder. Nor do I see anything on icloud.com or on my PC running iCloud software.Here is another weird behavior: Open the Finder and click on "all my files" and I see my file. Right click on the file and select "show in containing folder" and now I see my file appear with the full path to the file as you would expect. So far so good. Now when I click on "iCloud Drive" I see a new folder appear called "TextEdit" which was never there before. Now when I click on TextEdit I can see my file appear and I can open and view file contents. However, I still do not see anything on icloud.comI have iCloud enabled in my xcode project capabilities and I have my entitlements setup correctly as far as I can tell. I am using the default ubiquity container. I increased my build number each time I changed info.plist to make sure the settings will take affect. Here are relevant lines from info.plist :<key>NSUbiquitousContainers</key><dict><key>iCloud.com.mchartier.motoproto1</key><dict><key>NSUbiquitousContainerIsDocumentScopePublic</key><true/><key>NSUbiquitousContainerName</key><string>MotoProto1</string><key>NSUbiquitousContainerSupportedFolderLevels</key><string>None</string></dict></dict>So to summarize: My ubiquitous folder is not ubiquitous at all. The files created on the iPhone can only be viewed correctly by using the iCloud drive app on the phone itself. The files are clearly sent into the iCloud because they show up on the Mac filesystem but my app's ubiquity folder will not show up in the iCloud Drive folder in the Finder.
Post not yet marked as solved
CloudKit vs Firebase vs other 3rd parties.... pros and cons. I'm looking for a very detailed explanation of what to use and why. Please help me to understand what is the best. Maybe some are better in certain scenarios than others. I'm really looking for a detailed description to knock my socks off. Please dont respond with "becasue it's native." I need to why native specifically can be better. I'm a newer developer and looking for unbiased answer with strict facts backing up their answer. I would love to have an egineer or someone with massive network experience respond. Thanks in advance for the direction.Sincerely,Someone who is genuinely impressed by the mentorship & help of the community
Post not yet marked as solved
Cloudkit allows us to create a schema in development by saving records. This is great, and comes in handy if you want to restart your cloudkit development environment. Unfortunately AFAICT if you want the recordID to be indexable (so that you can do things like find all records of a type using the TRUEPREDICATE) you have to set this by hand in cloud kit dashboard. Is there a way to do this programmatically that I'm missing? How about a way to make this the default? I worry that I'll clean out my schema (in order to clean up before deployment) and fail to set the recordID indexable in the dashboard. I'll launch the app and it significant cloudKit functionality will be "broken" because of it.
Post not yet marked as solved
I'm repeatedly getting this error on one - but not all - CKQuery operation:CKError(_nsError: <CKError 0x608000846ff0: "Service Unavailable" (6/2022); "Request failed with http status code 503">)There's no further useful info in the UserInfo dictionary, including no value for the CKErrorRetryAfterKey.My code initially queries CloudKit for basically two fields: "name" and "hash". Hash is a hash value for a CKAsset file (on the same record) that I don't want to download unless the hash code indicates that the file has changed.For all the records whose hash codes indicate that I should download the CKAsset, I prepare the same query in the same code, but add the "json" field and rerun, to download only the json files that I need. I use this predicate, containing an array of the desired CKReferences NSPredicate.init(format: "recordID in %@", fullRecordsToDownload)The first query always works, the second always fails with the 503. Every time I repeat, it's the same pattern.Thus it can't really be that the service is unavailable, right?How can I diagnose this?