Skip to content

Instantly share code, notes, and snippets.

Created June 25, 2018 12:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
from ably import AblyRest
client = AblyRest('YOUR_KEY')
channel = client.channels.get('push:test')
item_type = u'this is item type'
event = u'this is event'
extras = {
'push': {
'notification': {
'title': 'Hello',
'body': 'Hello body',
'sound': 'Fresh_Notify.wav',
'collapseKey': u'oculd-{}-{}'.format(item_type, event)
'data': {
'item_type': item_type,
'event': event
'apns': {
'aps': {
'alert': {
'title-loc-key': u'{}-{}-NOTIFICATION-TITLE'.format(item_type, event).upper(),
'loc-key': u'{}-{}-NOTIFICATION-MESSAGE'.format(item_type, event).upper()
channel.publish(name='this is name', data='this is data', extras=extras)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment