首页 > 解决方案 > signWithCustomMethod 错误 [无效的断言格式。需要 3 个点分隔段。]

问题描述

firebase.auth().signInwithCustomToken().then().catch()

它由 3 个点分隔。我应该在 signInwithCustomToken() 方法的参数中传递什么?id 或一些令牌?PScreateCustomToken() 已弃用,因此我直接使用 signInWithCustomMethod 。此外,我仍在使用免费版本,即在 firebase 控制台中未启用计费。

标签: firebasereact-nativebasic-authentication

解决方案


只需以AuthProviderToken这种方式将字符串标记转换为:

if let credential = AccessToken.current?.tokenString { //String Token unwrapped
     let authCredential = FacebookAuthProvider.credential(withAccessToken: credential) // Auth Credential
...

快乐编码!


推荐阅读