Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions firebase_admin/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,19 @@ class Aps(object):
sound: Name of the sound file to be played with the message (optional).
content_available: A boolean indicating whether to configure a background update
notification (optional).
mutable_content: A boolean indicating whether to have the message be mutable
on device before final delivery (optional).
category: String identifier representing the message type (optional).
thread_id: An app-specific string identifier for grouping messages (optional).
"""

def __init__(self, alert=None, badge=None, sound=None, content_available=None, category=None,
thread_id=None):
def __init__(self, alert=None, badge=None, sound=None, content_available=None,
mutable_content=None, category=None, thread_id=None):
self.alert = alert
self.badge = badge
self.sound = sound
self.content_available = content_available
self.mutable_content = mutable_content
self.category = category
self.thread_id = thread_id

Expand Down Expand Up @@ -624,6 +627,8 @@ def encode_aps(cls, aps):
}
if aps.content_available is True:
result['content-available'] = 1
if aps.mutable_content is True:
result['mutable-content'] = 1
return cls.remove_null_values(result)

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions tests/test_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ def test_aps(self):
badge=42,
sound='s',
content_available=True,
mutable_content=True,
category='c',
thread_id='t'
),
Expand All @@ -612,6 +613,7 @@ def test_aps(self):
'badge': 42,
'sound': 's',
'content-available': 1,
'mutable-content': 1,
'category': 'c',
'thread-id': 't',
},
Expand Down