我收到"错误":{
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
当我尝试通过https://www.googleapis.com/plus/v1/people/me URL字符串获取Google+ api中的用户个人资料时.如果有人有任何建议,请尽快告诉我.在此先感谢您的时间.
我可以通过传递userId、nessageID和attachmentID来获取附件(参考:
我收到如下回复。
{
"data": "JVBERi0xLjYKJeTjz9IKMSAwIG9iagpbL1BERi9JbWFnZUIvSW1hZ2VDL0l...."
"size": 629163
}
我想解码数据以保存在我的本地应用程序中,稍后我将显示 .
我可以成功下载并保存在本地(文档文件夹)但看不到附件中的内容,请完善我。
我正在尝试使用针对Objective-C的Google API客户端库在youtube上传视频,我使用下面给出的代码,但它继续给我这个错误,我试图在youtube示例项目上运行我的帐户再次给它相同错误.
任何人都可以指导我问题在哪里.我在服务页面上查看了YouTube Data API v3.
*** Assertion failure in -[GTMHTTPUploadFetcher connectionDidFinishLoading:], /Volumes/data/Work/test/DLNew/DL/google-api-objectivec-client-read-only/Source/HTTPFetcher/GTMHTTPUploadFetcher.m:399
2013-08-30 14:28:31.399 [1250:907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unexpected response data (uploading to the wrong URL?)'
Run Code Online (Sandbox Code Playgroud)
我检查GTMHTTPUploadFetcher类的代码,它正在崩溃此链接上的应用程序
`#if DEBUG
// The initial response of the resumable upload protocol should have an
// empty body
//
// This assert typically happens because the upload create/edit link URL was
// not supplied with the request, and the server is thus expecting a non-
// resumable …Run Code Online (Sandbox Code Playgroud) 我想从Google云端硬盘应用中选择文件并下载元数据.我怎样才能做到这一点iOS中没有查询我自己喜欢的所有文件和显示这个?他们刚刚为webapp提供了选择器API:https://developers.google.com/picker/docs/
我将google drivs sdk与我的ios应用程序集成在一起.目前我使用以下代码从我的谷歌驱动器a/c下载文件基于下载URL链接.但是当我尝试下载谷歌文档文件(其中包含mime类型的应用程序/ vnd.google-apps.document)时,谷歌驱动器库中没有下载URL链接.在那种情况下,我如何下载谷歌文档数据?我可以使用alternateLink而不是下载url链接吗?任何帮助必须得到赞赏.
我的代码:
- (void)loadFileContent {
GTMHTTPFetcher *fetcher =
[self.driveService.fetcherService fetcherWithURLString:[[self.driveFiles objectAtIndex:selectedFileIdx] downloadUrl]];
[fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
if (error == nil) {
NSLog(@"\nfile %@ downloaded successfully from google drive", [[self.driveFiles objectAtIndex:selectedFileIdx] originalFilename]);
//saving the downloaded data into temporary location
} else {
NSLog(@"An error occurred: %@", error);
}
}];
Run Code Online (Sandbox Code Playgroud)
}
我正在通过Objective-C SDK上传图片到谷歌驱动器,今天早上我在上传完成后不断收到此错误:
2013-02-20 13:07:30.565 Transfer [1774:907] <0x1fab2b40 GDriveDataSource.m:(165)>发生错误:Error Domain = com.google.GTLJSONRPCErrorDomain Code = 400"无法完成操作. (不支持的内容类型:application/json-rpc; charset = utf-8)"UserInfo = 0x1fcc0690 {error =不支持的内容类型:application/json-rpc; charset = utf-8,GTLStructuredError = GTLErrorObject 0x1fcbfcc0:{message:"不支持的内容类型:application/json-rpc; charset = utf-8"代码:400 data:[1]},NSLocalizedFailureReason =(不支持的内容类型: application/json-rpc; charset = utf-8)}
我的代码已经工作了很多天,我最近没有改变.我肯定在upload parameters参数上设置了正确的mime类型.以下是代码的相关部分:
GTLDriveFile *file = [GTLDriveFile object];
file.title = asset.fileName;
file.mimeType = @"image/jpeg";
NSData *imageData = [asset getImageDataForResolutionType:resType];
GTLUploadParameters *uploadParameters = [GTLUploadParameters uploadParametersWithData:imageData
MIMEType:file.mimeType];
GTLQueryDrive *query = [GTLQueryDrive queryForFilesInsertWithObject:file
uploadParameters:uploadParameters];
Run Code Online (Sandbox Code Playgroud)
谢谢!
实际上我将google-drive-sdk与我的ios应用程序集成在一起.我可以通过google-drive-sdk for iOS在谷歌驱动器上传指定的文件.另外,我想提供一种功能,用于从用户希望在Google云端硬盘上传该文件的可用文件夹中选择文件夹.
因此,我找到了如何列出Google云端硬盘的所有文件,但无法找到如何列出Google云端硬盘的所有文件夹.
我还在Google Developer网站上浏览了整个API参考,但没有找到任何有关它的解决方案.
我找到了一个地方,使用下面的代码文件夹列表可以完成所以尝试它但它没有工作.
GTLQueryDrive *query = [GTLQueryDrive queryForFilesList];
query.q = @"mimeType='application/vnd.google-apps.folder' and trashed=false";
[self.driveService executeQuery:query completionHandler:^(GTLServiceTicket *ticket,
GTLDriveFileList *files,
NSError *error) {
if (error == nil) {
NSLog(@"Array of folder: %@", files.items);
} else {
NSLog(@"An error occurred: %@", error);
}
}];
Run Code Online (Sandbox Code Playgroud)
那么有什么解决方案可以使用google-drive-sdk从Google云端硬盘获取文件夹列表吗?
实际上我将google drive sdk与我的ios应用程序集成在一起.我可以通过谷歌驱动器ios sdk检索/上传谷歌驱动器中的文件.但是从指定的父文件夹中检索文件列表需要花费很多时间.
这里是我正在使用的步骤和代码.
首先获取指定父文件夹的子项,然后获取每个子项的GTLDriveChildReference,然后使用子引用标识符进行查询.
这对我来说是一个巨大的过程.此外,它每次都要求谷歌服务器.有更好的方法可以在查询中传递父文件夹ID并从该父文件夹中提取文件.
-(void)getFileListFromSpecifiedParentFolder {
GTLQueryDrive *query2 = [GTLQueryDrive queryForChildrenListWithFolderId:<some_id or root>];
query2.maxResults = 1000;
// queryTicket can be used to track the status of the request.
[self.driveService executeQuery:query2
completionHandler:^(GTLServiceTicket *ticket,
GTLDriveChildList *children, NSError *error) {
NSLog(@"\nGoogle Drive: file count in the folder: %d", children.items.count);
//incase there is no files under this folder then we can avoid the fetching process
if (!children.items.count) {
return ;
}
if (error == nil) {
for (GTLDriveChildReference *child …Run Code Online (Sandbox Code Playgroud) 是否可以在不要求用户登录以执行 OAuth 2.0 身份验证的情况下使用 google-api-objectivec-client 检索公共 youtube 播放列表?
我正在开发一个应用程序,该应用程序应该从 youtube 检索播放列表并播放相关视频,但我不能也不想要求用户登录。
在 google-api-objectivec-client ( https://code.google.com/p/google-api-objectivec-client/source/browse/#svn%2Ftrunk%2FExamples%2FYouTubeSample )的示例中,我无法无需 OAuth 2.0 身份验证即可实现。
谢谢,丹
ios ×6
objective-c ×4
base64 ×1
decoding ×1
gmail ×1
gmail-api ×1
google-plus ×1
iphone ×1
youtube-api ×1