A project that offers a very smooth integration to OneDrive API. Feel free to use the code in your integration projects; it should help you get started quickly.
2 integration options are available:
- Via Cocoapods in the master branch. Simply do a pod install after cloning the project.
- Old style drag and drop project file integration. This is offered in the retro_dependency branch. No installation steps required after cloning this branch. You just need to have the onedrive-ios-sdk project in the same directory level.
The project offers a very simple and lean interface to the OneDrive API. It provides one higher level of abstraction to the OneDrive API. Here is how the interface looks like:
@protocol OneDriveAPI <NSObject>
- (instancetype)init: (ODClient*) client;
- (BOOL) isLoggedIn;
- (void) logoutWithHandler: (void (^)(NSError *error)) handler;
- (void) rootFolder:(void (^)(ODItem *folder, NSError *error)) handler;
- (void) itemWithId: (NSString*) itemId completionHandler:(void (^)(ODItem *item, NSError *error)) handler;
- (void) downloadItemWithId: (NSString*) itemId completionHandler: (void (^)(NSURL *location, NSURLResponse *response, NSError *error)) handler;
- (void) uploadToRootFolder: (NSData*) data withFileName:(NSString*) filename completionHandler: (void (^)(ODItem *response, NSError *error)) handler;
- (void) uploadToFolderId: (NSString*) folderItemId theData: (NSData*) data withFileName:(NSString*) filename completionHandler: (void (^)(ODItem *response, NSError *error)) handler;
@end
The user interface offers a very simple way to perform basic OneDrive SDK operations.