ARCore - Cloud Anchor 使用 Api 密钥正常工作,但不能在 swift 中使用 jwt 令牌

问题描述 投票:0回答:0

目前我正在使用 api 密钥初始化 Google Session,但要求已更改,我需要使用 jwt 令牌进行初始化

初始化代码

do {
            gSession = try GARSession.session()
            gSession!.setAuthToken(AuthToken.authToken)
            printObj("Google Session Initialization Done with token")
        }catch let error {
            printObj("Failed to init Google Session with message: " + error.localizedDescription)
        }
        gSession?.delegate = delegate
        gSession?.delegateQueue = DispatchQueue.main

热门锚代码

_ = try self.gSession?.hostCloudAnchor(arAnchor, ttlDays: 10)

当我初始化 g 会话并设置身份验证令牌时,我没有收到任何错误,但是在托管锚点时在

session(_ session: GARSession, didFailToHost anchor: GARAnchor)
方法中调用。并且再次使用 api 密钥初始化时工作正常,需要更改什么?

我关注了谷歌文档链接:https://developers.google.com/ar/develop/ios/cloud-anchors/developer-guide#host-with-persistence

swift swiftui arcore arcore-limitation
© www.soinside.com 2019 - 2024. All rights reserved.