java - 使用 Firebase 登录
问题描述
在我的 Android 应用程序中使用 Google Login 和 firebase 我阅读了文档,但函数“firebaseAuthWithGoogle”不存在。
我的项目 Grandle 文件依赖项
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//Firebase
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
//Facebook
implementation 'com.facebook.android:facebook-login:4.32.0'
活动结果函数为
protected void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN_GOOGLE) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount account = result.getSignInAccount();
firebaseAuthWithGoogle(account);
} else {
// Google Sign In failed, update UI appropriately
// ...
}
}
callbackManager.onActivityResult(requestCode, resultCode, data);
}
我找不到解决方案。怎么了?
解决方案
推荐阅读
- git - 完成发布时我应该写什么作为标签消息?
- python - python:添加带有类装饰器参数的方法导致TypeError:add_bar()缺少1个必需的位置参数:'cls'
- ruby-on-rails - Rake aborted:加载错误,无法加载此类文件
- python - ImportError:重定位错误:R_AMD64_32:/scipy-1.6.2-py3.7-solaris-2.11-i86pc.64bit.egg/scipy/spatial/qhull.cpython-37m.so:符号(未知)
- vue.js - 无法运行命令“vue create app1”
- ios - xcodebuild 因 CodeSigning 错误而失败,但 xcode 应用程序成功
- google-cloud-platform - GCP 图像和元数据
- wordpress - wordpress htaccess 特定域
- azure-ad-b2c - 初始页面背景颜色自定义
- r - R泊松模拟函数