How to download google files in google drive sdk?
<p>In this way, I download a image successfully:</p>

<pre><code>GTLServiceDrive *drive = ...;
GTLDriveFile *file = ...;
NSString *url = [NSString stringWithFormat:@"https://www.googleapis.com/drive/v3/files/%@?alt=media",file.identifier];
GTMSessionFetcher *fetcher = [drive.fetcherService fetcherWithURLString:url];
[fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
  if (error == nil) {
    NSLog(@"Retrieved file content");
    // Do something with data
  } else {
    NSLog(@"An error occurred: %@", error);
  }
}];
</code></pre>

<p>the document of google drive sdk tell me to download a pdf or google docs should use another url:</p>

<pre><code>NSString *url = [NSString stringWithFormat:@"https://www.googleapis.com/drive/v3/files/%@/export?alt=media&amp;mimeType=application/pdf",file.identifier];
</code></pre>

<p>but I failed, error is this:</p>

<pre><code>{
 "error": {
  "errors": [
    {
     "domain": "global",
     "reason": "badRequest",
    "message": "Bad Request"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }
}
</code></pre>