Skip to content

Differences in sync package API #632

Description

@ttypic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions