Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1077 from mozilla-services/feat/1076
Browse files Browse the repository at this point in the history
bug: Update APNs APS block
  • Loading branch information
jrconlin authored Nov 14, 2017
2 parents 1c2e227 + b8b52e8 commit 7289761
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion autopush/router/apnsrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ def _route(self, notification, router_data):
payload["enckey"] = notification.headers["encryption_key"]
payload['aps'] = router_data.get('aps', {
"mutable-content": 1,
"alert": {"title": " ", "body": " "}
"alert": {
"loc-key": "SentTab.NoTabArrivingNotification.body",
"title-loc-key": "SentTab.NoTabArrivingNotification.title",
}
})
apns_id = str(uuid.uuid4()).lower()
# APNs may force close a connection on us without warning.
Expand Down
6 changes: 4 additions & 2 deletions autopush/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1938,8 +1938,10 @@ def test_registration(self):
assert ca_data['cryptokey'] == crypto_key
assert ca_data['enc'] == salt
assert 'mutable-content' in ca_data['aps']
assert ca_data['aps']['alert']['title'] == " "
assert ca_data['aps']['alert']['body'] == " "
assert ca_data["aps"]["alert"]["loc-key"] == \
"SentTab.NoTabArrivingNotification.body"
assert ca_data["aps"]["alert"]["title-loc-key"] == \
"SentTab.NoTabArrivingNotification.title"
assert ca_data['body'] == base64url_encode(data)

@inlineCallbacks
Expand Down
5 changes: 4 additions & 1 deletion autopush/tests/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ def test_route_notification(self):
"ver": 10,
"aps": {
"mutable-content": 1,
"alert": {"title": " ", "body": " "}
"alert": {
"loc-key": "SentTab.NoTabArrivingNotification.body",
"title-loc-key": "SentTab.NoTabArrivingNotification.title",
},
},
"enckey": "test",
"con": "aesgcm",
Expand Down

0 comments on commit 7289761

Please sign in to comment.