Getting Started
Cloudike files SDK has been developed to ensure the smooth workflow between Cloudike remote file system and iOS applications.
#
Requirements- Xcode 10.3 or later
- CocoaPods 1.4.0 or later
- Target of iOS 10 or later
- Swift 4+
#
Installation#
Before You BeginThis SDK is stored in the private pod repo and developed for use with the Cloudike Backend. If you need access, please "Contacts Us".
TODO @Anna виджет Contacts Us
#
Add SDK to Your AppCloudikeFiles SDK is available through CocoaPods or XCFramework static library. To install it, simply add the following lines to your Podfile:
# Add Cloudike podspec to sourcessource 'git@bitbucket.org:asdtech/pod_spec.git'
target 'YourApp' do # Add CloudikeFilesKit as dependency to your target pod 'CloudikeFilesKit', '~> 1.0.3.8'end
TBD XCFramework
#
InitializationTBD
#
Auth + SetupTBD
Cloudike files library requires a two-stage initialization. First, you have to initialize the CloudikeFilesManager instance, usually in AppDelegate.didFinishLaunchWithOptions The following example shows typical first stage initialization flow:
let clfm = CloudikeFilesManager.shared
Cloudike files library uses Realm DB under the hood, so it must be initialized too. You pass application context to the Cloudike files library initializer. During the first initialization stage, all components are created but not configured for network operations.
We recommend that you keep strong reference to CloudikeFilesManager instance to avoid being removed by ARC.
Before SDK functions could be used, the second initialization stage have to be done when the user has authenticated with the app. Here you can find information how to complete auth flow with Cloudike backend.
user-id
andauth-token
could be found in response to user-auth methodbackend-url
- API url, for example "https://api.cloudike.com"user-agent
- Consist of platform, OS version, App version, model of the smartphone and other meaningful information. See code below as an example of getting user-agent.unique-device-id
- Uniquely identifies device in the cloud. See example below.
clfm.prepareToWork( baseURL: backend-url, token: auth-token, profileID: user-id, userAgent: user-agent, deviceID: unique-device-id)
Once initialization is completed, you can call other methods. When the user has logged out, the app must call CloudikeFilesManager.shared.logout()
.
#
DependenciesFirst of all, you need to get access to Cloudike Pod repo. You can use this bitbucket account:
- login:
asd_maven_public@asdco.ru
- pass:
NHGweht8%S^%@gs
Here instructions how to add your ssh-key to account settings.
The following dependency must be added to your app's podfile:
target 'App' { ... pod 'CloudikeFilesManager'}
Cloudike files use RealmSwift and RxSwift.