Skip to main content

Getting Started

Requirements#

  • Xcode 10.3 or later
  • CocoaPods 1.4.0 or later
  • Target of iOS 10 or later
  • Swift 5+

Installation#

Before You Begin#

This 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 App#

CloudikePhotos 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 CloudikeContactsKit as dependency to your target    pod 'CloudikeContactsKit', '~> 0.5.8'end

TBD XCFramework

Initialization#

CloudikeContacts is a Singleton object, which will be created during first call of CloudikeContacts.shared property.

Before using SDK functions, you need to configure lib when the user is authenticated in the app. Read more about app Lifecycle

let core = CloudikeCore(apiBaseUrl: baseUrl)core.applyUser(apiToken: token,                userId: userId,                deviceId: deviceId)
let config = Configuration(backupNotes: false,                           eventDispatcher: ContactsHelper.shared,                           allowRequestPermissions: false)
CloudikeContacts.shared.configure(core: core, configuration: config)
  • baseUrl - backend api url, for example https://api.cloudike.com

  • apiToken and userId - user auth info. For example,it could be found in the response to user-auth method

  • backupNotes - if true, contact notes will be backed up

  • eventDispatcher - implementation of CloudikeContactsEventsProtocol

  • allowRequestPermissions - the BackupNotificationBuilder closure should be return UNNotificationContent for BackupFrequency

Then, setup is completed, you can call other methods. When the user has logged out, the app must call: BackupRestore.shared.logout().

Dependencies#