Krzysztof
Krzysztof

Reputation: 1471

How to get url to google drive file from GTLDriveFile?

In old version of the Google Drive API v2 a fileresource contained was alternateUrl which could be used to point to the file in browser. In latest version of Google Drive v3 a fileresource contains only webViewLink, but it's returned nil.

Maybe there is way to convert file identifier to url ?

Edit: As mentioned in similar question on stack overflow, the webViewLink is returned only for public folders. As a workaround i used for now:

[NSString stringWithFormat:@"https://drive.google.com/file/d/%@/view", file.identifier]

But not sure if this urls will be valid in future, perfectly google api would return something i could use to later open file in browser.

Upvotes: 2

Views: 656

Answers (1)

Andrew Lai
Andrew Lai

Reputation: 145

in my app, my webViewLink have value! You must in query action add following codefileListQuery.fields = @"*";

Upvotes: 3

Related Questions