#CloudStorages SDK for iOS ##What this is "CloudStorages SDK is a classlib for manageing all sorts of cloud datas such as the following ten: Box、DropBox、GoogleDrive、GoogleDocs、FTP、MyDisk、WebDav、EverNote、SugarSync、skyDrive. Current version:1.0" #Operating Environment
- armv7 supported
- iOS 5.0 and above supported
#File Import
###File Import process
####1. Import CloudStorages SDK; ####2.Add Dependency Framework
- - storeKit.framework
- - SystemConfiguration.framework
- - QuartzCore.framework
- - Security.framework
- - MobileCoreServices.framework
- - libxml2.dylib
- - UIKit.framework
- - Foundation.framework
- - CoreGraphics.framework
- - CFNetwork.framework
- - libz.dylib
####3. Set up the Cloud AppKey Open sdk/sur/CSCloudServerConfigurator.m, set AppKey information of cloud services accordingly.
- Register for an Box API ClientID and ClientSecret
- Register for an DropBox API ClientSecret
- Register for an GoogleDrive API ClientID and ClientSecret
- Register for an Evernote API ClientID and ClientSecret
- Register for an sugarSync API AppID、AccessKey and privateAccessKey
- Register for an skyDrive API ClientID
####4. Configurate URL Schema
- Open X-Info.plist (X means the name of your project) and create URL types in File setting (omit if it exists.); Extend URL types – URL Schemes and create AppKey:db-(DropBoxAppkey) for DropBox authorization and create another AppKey for Evernote authorization under URL Schemes.
- The ASIHTTPRequest Library used in this SDK does not support ARC modes. If the project is under ARC mode, please set compile flags -fno-obj-arc for all ASIHTTPRequest source files.
####5. Modify your AppDelegate
- In file "AppDelegate.m", import the header file#import <CloudSDK/CSCloudServer.h>
- In - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions, add code: [CSCloudServer setCloudConfigurator];
- In - (void)applicationDidBecomeActive:(UIApplication *)application, add code: [CSCloudServer handleDidBecomeActive];
- In - (BOOL) application:(UIApplication *) application openURL:(NSURL *) url sourceApplication:(NSString *) sourceApplication annotation:(id) annotation, add code:{return [CSCloudServer openURL: url];}
##Using the CloudStorages SDK from your code Example of use
-
CSCloudServer *cloudServer = [CSCloudServer cloudServerForType:serverType]; //Cloud service object initialization
-
if (cloudServer.isWebLogin){ [cloudServer loginFromController:self]; // Login the cloud when the cloud land mode is weblogin; }else{ cloudServer.useName = useName; cloudServer.password = password; cloudServer.hostname = hostname; cloudServer.port = port;
[cloudServer loginFromController:nil]; // Land cloud is a custom window; land mode parameters is nil; } -
[cloudServer logout]; //Log out
-
[cloudServer getRootListAndFolder];//Access root directory
-
[cloudServer getListAndFolderByFoler:folder];//Access folder directory path
-
[cloudServer downloadFile:fileObject toPath:savePath];//Download file
-
[cloudServer uploadFilePath:localFilePath toFolder:destinationFolder];//Upload a single file [cloudServer uploadFiles:localFilePathArr toFolder:destinationFolder];//Upload multiple files
-
[cloudServer createNewFolder:folderName inFolder:destinationFolder];//Create new folder
-
[cloudServer deleteFile:fileObject];//Delete the file
-
[cloudServer renameFile:fileObject withName:newName];//Rename
-
[cloudServer addToDownloadList:file withSavePath:path];//Add to download list
-
[cloudServer getPermissionList:file]; //Check administrators who have file permission
-
[cloudServer insertPermission:userName wihtRole:@"reader" toFile:file]; //Add visitors with file permission
-
[cloudServer deletePermission:file atPermissionID:permission]; //Remove this user's file permission. Note: you can't remove the file owner.
Attention
-
Initialize a cloud object to continue other relative operations before these operations;
-
Link the latest update to the Third-party libraries ASHTTPRequest TBXML in sugar sync.
Connect:
Email: [email protected]
Copyright (c) 2013, Kdan Mobile