我正在尝试在我的Android应用程序和网站上集成Google登录。
我将它们分别集成,并在网站上进行集成时,我收到一个服务器客户端ID,通过它我也集成了它的后端。
现在,当使用Firebase将其集成到Android中并从控制台下载Google配置Gson并在中传递相同的服务器端客户端ID时GoogleSignInoptions.requestIDToken,它崩溃了,因为该应用提供了两个服务器端ID客户端。
我不太确定如何解决这个问题。我的错误:
Process: com.example.ayush.bottomnavigation, PID: 23326
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ayush.bottomnavigation/com.example.ayush.bottomnavigation.SignInActivity}: java.lang.IllegalArgumentException: two different server client ids provided
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.IllegalArgumentException: two different server client ids provided
at com.google.android.gms.common.internal.zzab.zzb(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignInOptions$Builder.zzfs(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignInOptions$Builder.requestIdToken(Unknown Source)
at com.example.ayush.bottomnavigation.SignInActivity.onCreate(SignInActivity.java:64)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148) …Run Code Online (Sandbox Code Playgroud) android backend firebase firebase-authentication google-signin
假设我有这样的文件
{
"id" : "1415166669",
"color" : {
"14" : "Silver"
},
"name":"Random Name"
}
Run Code Online (Sandbox Code Playgroud)
内部颜色键可以更改的位置,即"下一个文档"可能如下所示
{
"id" : "1415126969",
"color" : {
"11" : "Gold"
},
"name":"Random Name 2"
}
Run Code Online (Sandbox Code Playgroud)
我想展平并重命名它们,以便我的文档具有如下相似的结构:
{
"id" : "1415126969",
"color" : "Gold"
"name":"Random Name 2"
}
Run Code Online (Sandbox Code Playgroud)
和
{
"id" : "1415166669",
"color" : "Silver"
"name":"Random Name"
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用聚合管道但我不确定如何继续进行.任何人都可以建议使用Robomongo的方式,这也很好.