Saving CloudKit Record “Not Authenticated” (9/1002)“ ”This request requires an authenticated account“”

后端 未结 6 867
星月不相逢
星月不相逢 2021-02-12 12:33

Saving a CKRecord in the simulator gives me the following error:

[publicDatabase saveRecord:cloudRouteEntity completionHandler:^(CKRecord *record, NS         


        
相关标签:
6条回答
  • 2021-02-12 13:19

    I'm seeing the same error. According to the discussion linked below the cause might be two-factor authentication.

    https://discussions.apple.com/thread/6588883

    0 讨论(0)
  • 2021-02-12 13:20

    I got the same problem, which I was able to resolve by logging in to my iCloud account in the simulator (Settings > iCloud).

    As of the latest Xcode, you can log in to your iCloud account in the simulator, and everything should work.

    If you are having trouble logging in, try to go to iCloud.com on a desktop and log in there first. Once that is set up properly, then try in the simulator.

    0 讨论(0)
  • 2021-02-12 13:20

    I had similar issue unless I did login into Settings app/iCloud section on my iPad Retina iOS8.1.1

    0 讨论(0)
  • 2021-02-12 13:23

    Because folks might misinterpret the approved answer (as I did) here is a little more detail to get through this (you can use keyboard shortcuts but I am specifying menu selections for clarity):

    1. Run simulator (Xcode) - Run an app from Xcode in the simulator by selecting Product > Run
    2. App Home Screen (Simulator) - Within the simulator, navigate to the Home screen by selecting Hardware > Home
    3. Settings App (Simulator) - Find the settings app (gear), run it and select iCloud
    4. Authenticate (Simulator) - Enter your credentials and login (or re-login if your credentials have changed) to iCloud. Once you do this you can re-run your app and it should properly authenticate to iCloud

    Once you do this you are good to go for future builds and runs.

    0 讨论(0)
  • 2021-02-12 13:36

    Reset the simulator completely (make sure nothing is left), re-install it. Maybe you got a wrong bit version? If possible, try if it works on a other PC or Laptop.

    I tested it and i was able to connect to iCloud so i am pretty sure its something about your settings / wrong install etc.

    0 讨论(0)
  • 2021-02-12 13:39

    I was having the same problem.

    I has added an id query index in the Users Records, when i removed this index the problem stopped.

    I dont even know whats the relation between these things, but it worked for me.

    Sorry for the bad english

    0 讨论(0)
提交回复
热议问题