Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apns.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,14 @@ def __init__(self, payload_size):
class Payload(object):
"""A class representing an APNs message payload"""
def __init__(self, alert=None, badge=None, sound=None, category=None, custom=None, content_available=False,
mutable_content=False):
mutable_content=False, thread_id=None):
super(Payload, self).__init__()
self.alert = alert
self.badge = badge
self.sound = sound
self.category = category
self.custom = custom
self.thread_id = thread_id
self.content_available = content_available
self.mutable_content = mutable_content
self._check_size()
Expand All @@ -327,13 +328,16 @@ def dict(self):
if self.category:
d['category'] = self.category

if self.thread_id:
d.update({'thread_id': self.thread_id})

if self.content_available:
d.update({'content-available': 1})

if self.mutable_content:
d.update({'mutable-content': 1})

d = { 'aps': d }
d = {'aps': d}
if self.custom:
d.update(self.custom)
return d
Expand Down