【发布时间】:2019-12-21 11:40:18
【问题描述】:
我正在 Flutter 中使用 Line App Login,我可以在 Line API 中获取用户令牌,但我不知道下一步该做什么。
现在我正在尝试在 FirebaseAuth.instance.signInWithCustomToken(token:customToken) 中使用它,但它不起作用。错误日志显示“PlatformException(ERROR_INVALID_CUSTOM_TOKEN,自定义令牌格式不正确。请查看文档。[无效的断言格式。],null)”是否有解决此问题的方法?
lineSignIn() async {
_flutterLineLogin.startLogin(_onLoginSuccess, _onLoginError);
}
void _onLoginSuccess(dynamic value) {
FirebaseAuth.instance.signInWithCustomToken(token:value['accessToken'].toString()).then((onValue) {
if (onValue != null) {
///this should be success
}
}).catchError((onError) {
print(onError.toString());
});
}
void _onLoginError(Object error) {
debugPrint("PlatformException: ${error}");
}
我只需要在 firebase 中验证令牌。提前谢谢大家!
【问题讨论】:
-
这里也一样。你找到解决办法了吗?
标签: android ios firebase flutter google-cloud-firestore