The Channel API provides the following functions in the module
- create_channel(client_id, duration_minutes=None)
- The number of minutes for which the returned token will be valid.
None, use default (120 minutes). If specified, the value must be greater than zero and less than 24 * 60.
- send_message(client_id, message)
Asynchronously sends a message to a channel. No error is returned if the message cannot be delivered. If the
client_idparameter is actually a token returned by a
send_messagecan be used for different versions of the app. For instance you could create the channel on the front end and then send messages from a backend of the app.
client_idused in a
create_channelcall or the token returned by such a call. The advantage of using the token is that
send_messagewill work from a different version of the application than the one that created the channel.
- The message passed to the client.