小编Die*_*icx的帖子

尝试保存记录时,Cloudkit会出错

我试图简单地将记录保存到用户私有数据库但是当我运行privateDB.saveRecord()时,我得到一个错误说

Not Authenticated" (9/1002); "CloudKit access was denied by user settings"; Retry after 3.0 seconds>.
Run Code Online (Sandbox Code Playgroud)

此帐户可以登录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()
    }
})
Run Code Online (Sandbox Code Playgroud)

macos icloud icloud-api swift cloudkit

6
推荐指数
1
解决办法
2542
查看次数

在Kubernetes中运行时,Firebase Admin Go SDK仅获得x509证书错误

我目前正在使用Firebase Admin Go SDK处理一个项目,以处理身份验证和使用实时数据库。当我在本地运行该项目时,该项目可以正常运行(只需运行go run main.go)。当我通过docker映像(或GKE,我已经测试了两者)在Minikube中运行它时,每当尝试进行任何Firestore调用时,都会出现此错误:

transport: authentication handshake failed: x509: certificate signed by unknown authority
Run Code Online (Sandbox Code Playgroud)

这是我在服务器上用来调用数据库的代码:

transport: authentication handshake failed: x509: certificate signed by unknown authority
Run Code Online (Sandbox Code Playgroud)

这是我的Dockerfile,它添加了控制台提供的服务帐户密钥Firebase:

FROM scratch

ADD main /
ADD serviceAccountKey.json /

EXPOSE 9090

ENTRYPOINT ["/main", "-grpc-port=9090", "-http-port=9089", "-env=prod"]
Run Code Online (Sandbox Code Playgroud)

我在文档中找不到有关在Kubernetes中运行的任何内容。
要从Kubernetes连接到Firestore,我需要做些什么?

go firebase kubernetes firebase-admin google-cloud-firestore

5
推荐指数
1
解决办法
319
查看次数