Google Drive API

I have not been able to find any code examples of accessing the Google Drive API with Objective-C. Does anyone know where to find some? I have the Google Client libraries incorporated into my project, but I don't know how to start with the code.

I am particularly interested in how the authentication works since redirecting to authorization url and then back to the app like you do for web apps doesn't seem like it would work for a native iOS app.

Thanks! Chris


Support for Objective C is only in alpha stage apparently.

You can find a sample drive application on google code there: http://code.google.com/p/google-api-objectivec-client/source/browse/trunk/Examples/DriveSample/

For authentication you use GTMOAuth2Authentication with an OAuth token, typically stored in the keychain:

// Load the OAuth token from the keychain, if it was previously saved
NSString *clientID = [clientIDField_ stringValue];
NSString *clientSecret = [clientSecretField_ stringValue];

GTMOAuth2Authentication *auth;
auth = [GTMOAuth2WindowController authForGoogleFromKeychainForName:kKeychainItemName
                                                          clientID:clientID
                                                      clientSecret:clientSecret];
链接地址: http://www.djcxy.com/p/92414.html

上一篇: 递归克隆git仓库不会拉动子模块

下一篇: Google Drive API