Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Created July 11, 2019 17:08
Show Gist options
  • Save bookercodes/18aeee99f7db9bd500538f16eec24805 to your computer and use it in GitHub Desktop.
Save bookercodes/18aeee99f7db9bd500538f16eec24805 to your computer and use it in GitHub Desktop.
CometChat.login(UID: "bendewberry", apiKey: "API_KEY", onSuccess: { (user) in
print("Login successful : " + user.stringValue())
})
let textMessage = TextMessage(
receiverUid: "#General",
text: "Hi everyone",
messageType: .text,
receiverType: .group)
CometChat.sendTextMessage(message: textMessage, onSuccess: { (message) in
print("TextMessage sent successfully. " + message.stringValue())
})
extension ViewController: CometChatMessageDelegate {
func onTextMessageReceived(textMessage: TextMessage) {
print("TextMessage received successfully: " + textMessage.stringValue())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment