Sending a plain text message is really simple. Just call the sendTextMessage() function on the Mitter.Messaging instance and pass a channel ID and text payload.
1
appDelegate.mitter.messaging.sendTextMessage(
2
forChannel: "rakfT-XPdJb-WsucS-Pxy4B",
3
"Hello from iOS!"
4
) { result in
5
switch result {
6
case .success:
7
print("Message sent!")
8
case .error:
9
print("Couldn't send message")
10
}
11
}
Copied!
Here you can specify the channel ID that you got while creating a new channel in the previous step.
Run the project and it should send out a new message to the channel.
Get messages in a channel
You can get messages sent to a particular channel by calling the getMessagesInChannel() and passing in the channel ID: