In sync version publish only works with array of messages and in regular (async) package publish works with single message object:
sync:
fromably.syncimportAblyRestSyncfromably.types.messageimportMessagedefmain():
ably=AblyRestSync('<your_api_key>')
channel=ably.channels.get('push:12345')
extras= {
'push': {
'notification': {"title": "Testing"},
}
}
message=Message(name='event', data='message', extras=extras)
channel.publish([message])
if__name__=="__main__": main()async:
fromablyimportAblyRestfromably.types.messageimportMessagedefmain():
ably=AblyRest('<your_api_key>')
channel=ably.channels.get('push:12345')
extras= {
'push': {
'notification': {"title": "Testing"},
}
}
message=Message(name='event', data='message', extras=extras)
channel.publish(message)
if__name__=="__main__": main()┆Issue is synchronized with this Jira Task by Unito
In
syncversionpublishonly works with array of messages and in regular (async) package publish works with single message object:sync:
async:
┆Issue is synchronized with this Jira Task by Unito