简体   繁体   English

如何从我的应用程序访问谷歌驱动器 api

[英]How do I access google drive api from my app

I try to access google drive from my app so for that authentication required.我尝试从我的应用程序访问谷歌驱动器,因此需要进行身份验证。 I setup the code in developer console.but when I try to implement GoogleSignInOption and GoogleSignInClient code it display mail popup which are logged in by my device but when I pressed any one mail it can not proceed further, just only show progressbar,what I do console not show any error too.我在开发人员控制台中设置了代码。但是当我尝试实现 GoogleSignInOption 和 GoogleSignInClient 代码时,它会显示由我的设备登录的邮件弹出窗口,但是当我按下任何一封邮件时,它无法继续进行,只显示进度条,我做什么控制台也没有显示任何错误。

My code was:我的代码是:

GoogleSignInOptions signInOptions = new 
GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                                       .requestEmail()
                                        .requestScopes(new Scope(DriveScopes.DRIVE_FILE)).build();
    GoogleSignInClient client = GoogleSignIn.getClient(this,signInOptions);
    startActivityForResult(client.getSignInIntent(),REQUEST_CODE_SIGN_IN);

process is not entered in onActivityResult method,please let me know what to do for solve this problem.在 onActivityResult 方法中没有输入进程,请告诉我如何解决这个问题。

This is a google bug, to fix it you have to set your app status as published in Google Developers Console这是一个谷歌错误,要修复它,您必须将您的应用状态设置为在 Google Developers Console 中发布

Go to the Developers console and click in the Google OAuth Consent Screen part Go 到开发者控制台并点击 Google OAuth 同意屏幕部分

Then click in Publish app to set your app status as published然后单击发布应用程序以将您的应用程序状态设置为已发布

在此处输入图像描述

This is needed because of a Google bug you can check it out here: https://issuetracker.google.com/issues/178183308这是需要的,因为您可以在此处查看 Google 错误: https://issuetracker.google.com/issues/178183308

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Google Drive API密钥从android应用程序访问驱动器内容? - How do I use the Google drive API key to access drive content from android application? 如何仅使用Google Android应用中的Google Drive API在Google云端硬盘上创建和编辑电子表格文件? - How do I create & edit a spreadsheet file on google drive using Google Drive APIs only from my Android app? 如何让其他应用(例如Google云端硬盘应用)访问我的应用数据 - How to let other app access my app's data like Google Drive app do 从我的应用访问我的Google Drive API - Accessing my Google Drive API from my App 如何限制Google App Engine端点API只能访问我的Android应用程序? - How do I restrict Google App Engine Endpoints API access to only my Android applications? 在我的应用程序中访问Google云端硬盘数据 - Access Google drive data in my app 使用Google Drive API备份我的应用 - Using Google Drive API to backup my app 如何将我的 Android 应用程序连接到谷歌驱动器? - How can i connect my Android app to google drive? 来自服务器的Google Drive API访问文件 - Google Drive API access files from Server 适用于Android的云端硬盘API:如何列出Google云端硬盘文件夹中的每个条目(以及不是由我的应用创建的条目) - Drive API for Android: how to list every entry in Google Drive folder (also those not created by my app)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM