Cloudrail Tutorial
Cloudrail Useful Resources
Selected Reading
- Cloudrail - Coding
- Cloudrail - Setup
- Cloudrail - Social Login
- Cloudrail - IOS
- Cloudrail - Node.js
- Cloudrail - Java
- Cloudrail - Android
- Cloudrail - Overview
- Cloudrail - Home
Cloudrail Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Cloudrail - IOS
Cloudrail - IOS
This section gives an introduction on how to use CloudRail s iOS SDK.
Setup
The easiest way to install is via CocoaPods. Simply add the following to your podfile −
pod "cloudrail-si-ios-sdk"
Make sure the "use_frameworks!" flag is set and run
Pod install
Usage
The following examples shows how to download a file from any cloud storage provider in Objective-C and Swift.
objective-c // self.service = [[CROneDrive alloc] initWithCpentId:@"cpentIdentifier" cpentSecret:@"cpentSecret" redirectUri:@"REDIRURL" state:@"CRSTATE"]; // self.service = [[CRGoogleDrive alloc] initWithCpentId:@"cpentIdentifier" cpentSecret:@"cpentSecret" redirectUri:@"REDIRURL" state:@"CRSTATE"]; // self.service = [[CRBox alloc] initWithCpentId:@"cpentIdentifier" cpentSecret:@"cpentSecret" redirectUri:@"REDIRURL" state:@"CRSTATE"]; [CRCloudRail setAppKey:@"CLOUDRAIL_API_KEY"]; self.service = [[CRDropbox alloc] initWithCpentId:@"cpentIdentifier" cpentSecret:@"cpentSecret" redirectUri:@"REDIRURL" state:@"CRSTATE"]; NSInputStream * object = [self.service downloadFileWithPath:@"/mudkip.jpg"]; //READ FROM STREAM swift //let cloudStorage : CloudStorageProtocol = Box.init(cpentId: "CpentID", cpentSecret: "CpentSecret") //let cloudStorage : CloudStorageProtocol = GoogleDrive.init(cpentId: "CpentID", cpentSecret: "CpentSecret") //let cloudStorage : CloudStorageProtocol = OneDrive.init(cpentId: "CpentID", cpentSecret: "CpentSecret") CRCloudRail.setAppKey("CLOUDRAIL_API_KEY") let cloudStorage : CloudStorageProtocol = Dropbox.init( cpentId: "CpentID", cpentSecret: "CpentSecret") do { let inputStream = try cloudStorage.downloadFileWithPath("/TestFolder/Data.csv") } catch let error{ print("An error: (error)") } //READ FROM STREAMAdvertisements