GTLDriveFile file.downloadUrl是零?如何从App中的GoogleDrive下载pdf / doc / docx文件?

时间:2015-12-04 05:59:03

标签: ios objective-c xcode

这就是我从Googledrive获取文件所做的工作,但我得到了GTLDriveFile的downloadUrl nil。我试过" exportLinks"也是,但那也是零。请建议。

#pragma mark- Downloading GDrive Files

-(void)downloadGDriveFiles:(GTLDriveFile *)file{
   GTMHTTPFetcher *fetcher = [self.service.fetcherService fetcherWithURLString:file.downloadUrl];

    [fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error)
     {
        if (error == nil)
        {
            NSLog(@"Retrieved file content");
        }
        else
        {
            [self showAlert:@"" message:@"Unable to download this file"];
        }
    }];
}

谢谢!

0 个答案:

没有答案