Android无法识别Firebase'createCustomToken' [英] Firebase 'createCustomToken' not recognized in Android
问题描述
我正在实现使用自定义令牌登录".我在 Firebase文档中找到了此代码段. /p>
I'm implementing "login with custom token". I found this snippet of code in the Firebase documentation.
firebaseAuth.createCustomToken(uid)
.addOnSuccessListener(new OnSuccessListener<String>() {
@Override
public void onSuccess(String customToken) {
// Send token back to client
}
});
我已将此代码放入"onCreate"方法内,并且无法识别"createCustomToken":
I have put this code inside the 'onCreate' method and 'createCustomToken' is not being recognized:
知道我在做什么错吗? 预先感谢!
Any idea what I'm doing wrong? Thanks in advance!
推荐答案
,您尝试将Firebase Admin SDK与Android SDK混合使用.方法createCustomToken仅在Admin SDK上可用,而不适用于Android SDK. Android的文档可以在这里找到
you try to mix up the Firebase Admin SDK with the Android SDK. The method createCustomToken is only available at the Admin SDK and not for the Android SDK. The docs for Android can be found here
https://firebase.google.com/docs/auth/android/开始/
只能在服务器端使用Admin SDK
The Admin SDK can only be used at server side
这篇关于Android无法识别Firebase'createCustomToken'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!