Created
July 11, 2019 17:02
-
-
Save bookercodes/60d8043f093d11dbe80962ac17012b12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CometChat.init(this, "APP_ID", object : CometChat.CallbackListener<String>() { | |
override fun onSuccess(p0: String?) { | |
Log.d(TAG, "Initialization completed successfully") | |
} | |
}) | |
CometChat.login("bendewberry", object : CometChat.CallbackListener<User>() { | |
override fun onSuccess(p0: User?) { | |
Log.d(TAG, "Login Successful : " + p0?.toString()) | |
} | |
}) | |
TextMessage textMessage = new TextMessage( | |
"#General", | |
"Hi everyone", | |
CometChatConstants.MESSAGE_TYPE_TEXT, | |
CometChatConstants.RECEIVER_TYPE_GROUP) | |
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() { | |
@Override | |
public void onSuccess(TextMessage textMessage) { | |
Log.d(TAG, "Message sent successfully: " + textMessage.toString()); | |
} | |
}) | |
CometChat.addMessageListener("#General", object : CometChat.MessageListener() { | |
override fun onTextMessageReceived(p0: TextMessage?) { | |
Log.d(TAG, "Message received successfully: " + p0?.toString()) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment