Cloudkit public container access fails if iCloud account has never been setup on device

Originator:paul
Number:rdar://21695434 Date Originated:7/6/2015
Status:Open Resolved:
Product:iOS Product Version:8.3, 8.4
Classification: Reproducible:Yes
 
Summary:
If you try to CKQuery the defaultContainer's publicCloudDatabase on a device that has never had an iCloud account setup then the query fails.  Accessing Public data is documented as being able to work whether you are signed on to an iCloud account or not.

If you are on an LTE connection it gets this error:
LTE connection:
<CKError 0x00: "Network Failure" (4/-1009); "The Internet connection appears to be offline.”>

If you are on a WiFi connection it gets this error:
<CKError 0x00: "Request Rate Limited" (7/2008); "This operation has been rate limited"; Retry after 3.0 seconds>

At this point if you setup an iCloud account on the device, the same query will then succeed.  If you then log out of the iCloud account, the same query will then still succeed.

Steps to Reproduce:
1. Device that never had iCloud account, query to a default container's public database fails.
2. Setup iCloud account on same device, same query succeeds.
3. Remove iCloud account (sign out), same query still succeeds.

Expected Results:
Per documentation, a CKQuery to a default container's public database should succeed.

Actual Results:
App fails on device that does not have iCloud account when it should work.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!