Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/Account.swift Secret
Created May 8, 2020

Embed
What would you like to do?
// ios/EncryptedStream/Account.swift:39
private func setupStream(_ completion: @escaping () -> Void) {
AF
.request("\(apiRoot)/v1/stream-credentials",
method: .post,
headers: ["Authorization" : "Bearer \(authToken!)"])
.responseJSON { response in
let body = response.value as! NSDictionary
let token = body["token"]! as! String
let apiKey = body["apiKey"]! as! String
Client.config = .init(apiKey: apiKey, logOptions: .info)
Client.shared.set(
user: User(id: self.userId!),
token: token
)
self.setupVirgil(completion)
}
}
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.