Skip to content

Instantly share code, notes, and snippets.

@nparsons08

nparsons08/VirgilClient.swift Secret

Created May 8, 2020
Embed
What would you like to do?
// ios/EncryptedChat/VirgilClient.swift:4
class VirgilClient {
public static let shared = VirgilClient()
private var eThree: EThree? = nil
// ...
public static func configure(identity: String, token: String) {
let tokenCallback: EThree.RenewJwtCallback = { completion in
completion(token, nil)
}
let eThree = try! EThree(identity: identity, tokenCallback: tokenCallback)
eThree.register { error in
if let error = error {
if error as? EThreeError == .userIsAlreadyRegistered {
print("Already registered")
} else {
print("Failed registering: \(error.localizedDescription)")
}
}
}
shared.eThree = eThree
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.