単純にレコードをユーザーのプライベート データベースに保存しようとしていますが、privateDB.saveRecord() を実行するとエラーが発生します。
Not Authenticated" (9/1002); "CloudKit access was denied by user settings"; Retry after 3.0 seconds>.
このアカウントは cloudkit ダッシュボードにサインインできるため、アプリケーションの開発者です。これを引き起こす可能性のある他の問題は何ですか? どんな助けでも本当にありがたいです、私はこれに長い間立ち往生しています。
これが私のコードです:
//variable instantiation
container = CKContainer.defaultContainer()
println(container.containerIdentifier)
publicDB = container.publicCloudDatabase
privateDB = container.privateCloudDatabase
//save record code
let passRecord = CKRecord(recordType: "Password")
passRecord.setValue("testytestPow", forKey: "title")
passRecord.setValue("password02", forKey: "value")
privateDB.saveRecord(passRecord, completionHandler: { (record, error) -> Void in
if (error != nil) {
println(error)
} else {
NSLog("Saved in cloudkit")
self.fetchTodos()
}
})