Protocols

URLSessionDataTaskProtocol

public protocol URLSessionDataTaskProtocol

Methods

resume()

func resume()

URLSessionProtocol

public protocol URLSessionProtocol

Methods

httpDataTask(with:completionHandler:)

func httpDataTask(with request: URLRequest,

UserStorage

@objc public protocol UserStorage

A type representing storage, where already authenticated users will be kept between app launches. By default this SDK uses concrete implementation of the protocol done at SQLiteUserStorage class.

Also keep in mind, that this protocol doesn’t provide any data encryption and therefore developers have to implement it by themselves.

Methods

loadStorage()

func loadStorage() throws

add(user:)

func add(user: User) throws

Adds new user to the storage

  • Parameter user: already registered user.
Parameters
Name Description
user already registered user.

userExists(with:)

func userExists(with userId: String) -> Bool

Check whether there is a user in storage with given user id.

  • Parameter userId: user id, that is checked in the storage.
Parameters
Name Description
userId user id, that is checked in the storage.

deleteUser(by:)

func deleteUser(by userId: String) -> Bool

Deletes user with given user id.

  • Parameter userId: user id for which user have to be deleted.
Parameters
Name Description
userId user id for which user have to be deleted.

all()

func all() -> [User]

Get all users written in storage.