thumbnailLink不会使用iOS Google Drive API返回任何文件 [英] thumbnailLink not returning for anyfile using iOS Google Drive API
本文介绍了thumbnailLink不会使用iOS Google Drive API返回任何文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ pre $ GT $查询=
query.pageSize = 50;
query.fields = @nextPageToken,文件(id,name,thumbnailLink,imageMediaMetadata);
query.q = @(mimeType ='image / jpeg'或mimeType ='image / png');
[self.service executeQuery:query
delegate:self
didFinishSelector:@selector(displayResultWithTicket:finishedWithObject:error :)];
不幸的是,即使我删除了mimetype条件(列出所有文件),返回的GTLDrive记录也不包含thumbnailLink 。有什么我错过了吗?
解决方案
简单的解决方案是,l使用了不正确的作用域,这意味着API只能访问驱动器元数据。将范围更新为以下解决了我的问题:
https://www.googleapis.com/auth/drive.photos。只读
Ideally l want to display the thumbnails for images stored on a users Google Drive. The code l'm using is:
GTLQueryDrive *query = [GTLQueryDrive queryForFilesList];
query.pageSize = 50;
query.fields = @"nextPageToken, files(id, name, thumbnailLink, imageMediaMetadata)";
query.q = @"(mimeType='image/jpeg' or mimeType='image/png')";
[self.service executeQuery:query
delegate:self
didFinishSelector:@selector(displayResultWithTicket:finishedWithObject:error:)];
Unfortunately even if l remove the mimetype condition (to list ALL files), no GTLDrive record returned contains thumbnailLink. Is there something l'm missing?
解决方案
Simple solution, l was using the incorrect scope, which meant the API only had access to the Drives metadata. Updating the scope to the following solved my issue:
https://www.googleapis.com/auth/drive.photos.readonly
这篇关于thumbnailLink不会使用iOS Google Drive API返回任何文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文