Skip to content

Instantly share code, notes, and snippets.

@nparsons08

nparsons08/Account.swift Secret

Created May 4, 2020
Embed
What would you like to do?
// ios/TheStream/Account.swift:86
func createPrivateChannel(_ user: String, _ withUser: String, completion: @escaping (Channel) -> Void) {
let users = [user, withUser]
let channelId = users.sorted().joined(separator: "-")
let channel = StreamChatClient.Client.shared.channel(
type: .messaging,
id: channelId,
members: users.map { StreamChatClient.User(id: $0) }
)
channel.create { (result) in
completion(try! result.get().channel)
}
}
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.