我正在使用Firebase在我的应用程序上设置登录名,我为我的登录名提供程序选择了Github提供程序。我尝试调试并从调试变量访问数据,但无法从代码访问。这是我的代码:
var firebaseAuth = FirebaseAuth.getInstance()
var provider: OAuthProvider.Builder = OAuthProvider.newBuilder("github.com")
// login handler
btn_login.setOnClickListener {
firebaseAuth.startActivityForSignInWithProvider(this, provider.build())
.addOnSuccessListener{ result: AuthResult ->
System.out.println(result.credential)
}
.addOnFailureListener {
exception -> print(exception)
}
}
和System.out:
I/System.out: com.google.firebase.auth.FirebaseAuthWebException: The web operation was canceled by the user.com.google.firebase.auth.zzg@588c9c4
在调试中,我找到了访问令牌,但无法访问它。
((result as zzh).zzc as zzg).accessToken
//399kdkkda0XXXXX
谢谢您的帮助