https://developers.google.com/identity/sign-in/android/start-integrating
但是,下面的代码总是导致APIException
(com.google.android.gms.common.api文件.ApiException:10:,状态{statusCode=DEVELOPER\uerror,resolution=null})。
我按照下面的链接跟踪了代码片段:
https://developers.google.com/identity/sign-in/android/sign-in
private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
try {
GoogleSignInAccount account = completedTask.getResult(ApiException.class);
// Signed in successfully, show authenticated UI.
String k="";
} catch (ApiException e) {
// The ApiException status code indicates the detailed failure reason.
}
}
我还想知道在Google云控制台项目的OAUth creadential中显示的客户端机密(可下载的JSON文件)有何用途?
我也读过一些关于谷歌的文章-服务.json我没有添加到我的项目中的文件,因为我遵循的Google开发人员文档(上面提到)没有提到这样的活动。我也没有在Google云控制台中看到这样一个文件,在我的项目的OAuth凭证中。我是不是少了点什么?