Skip to main content

CloudikeFilesKit

SDK for working with Cloudike files — upload, sync, and file management.

Applies to CloudikeFilesKit 3.8.2+

Installation

Cloudike SDKs for iOS are distributed through CocoaPods as prebuilt dynamic XCFrameworks from Cloudike's private pod repository.

1. Set up access (once per machine). Cloudike provides you with a username and a deploy token. Add them to ~/.netrc — both git (to fetch the pod specs over HTTPS) and curl (which CocoaPods uses to download the framework archives) read credentials from this file:

~/.netrc
machine git.cloudike.com login <username> password <token>

Make the file readable only by you:

chmod 600 ~/.netrc

2. Add the SDK to your Podfile. Declare the Cloudike pod repository as a source and add CloudikeFilesKit and its required CloudikeCoreKit dependency:

Podfile
source 'https://git.cloudike.com/cloudike-ios/pod_spec_binary.git'
source 'https://cdn.cocoapods.org/'

platform :ios, '13.0'
use_frameworks!

target 'YourApp' do
pod 'CloudikeFilesKit'
pod 'CloudikeCoreKit'
end
  • The https://cdn.cocoapods.org/ source is needed for the SDKs' third-party dependencies (for example, Kingfisher used by CloudikeDocumentWalletKit).
  • use_frameworks! is required — the SDKs are shipped as dynamic frameworks.
  • The minimum supported iOS version is 13.0.

3. Install the pods:

pod install

Initialization

import CloudikeCoreKit
import CloudikeFilesKit

let apiBaseUrl = URL(string: "https://your-api-endpoint.example.com")! // your Cloudike API endpoint
let core = CloudikeCore(apiBaseUrl: apiBaseUrl)
core.applyUser(apiToken: apiToken, userId: userId, deviceId: deviceId) // values from your sign-in flow

let files = CloudikeFiles(core: core, externalLogHandler: nil)
files.configure { error in
guard error == nil else {
// handle setup failure
return
}
// files is now ready to use
}

Creates a CloudikeCore session and authenticates it, then creates a CloudikeFiles instance built on that session and prepares its local storage and network layer. CloudikeFiles.configure(completion:) must complete before using any of its service properties.

First API Call

import Combine

var cancellables = Set<AnyCancellable>()

files.browserService
.recentNodesPublisher(limit: 20, sort: nil)
.sink { recentNodes in
print("Recent files:", recentNodes.count)
}
.store(in: &cancellables)

Subscribes to the SDK's publisher of recently changed files. Once it emits, the console prints the number of files found (0 or more, depending on the account's content) — confirming the SDK is initialized and can read data from the account.

Logout

files.logout {
print("Files SDK logged out")
}

Call this when the signed-in user logs out of the app, before discarding the CloudikeFiles instance. It clears the current user's local state — cached files database, pending uploads, and any in-memory session data — without deleting anything on the server. The completion callback is optional and is called once cleanup finishes.