Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs & tests to reflect APNs usage in FCM v1 API #370

Merged
merged 4 commits into from
Apr 29, 2024
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
1 change: 1 addition & 0 deletions changelog.d/370.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update docs & tests to reflect APNs usage in FCM v1 API.
2 changes: 1 addition & 1 deletion docs/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ with `event_id_only` format.
"room_alias": "#exampleroom:example.org",
"sender_display_name": "Major Tom",
"content_msgtype": "m.text",
"content_body": "I'm floating in a most peculiar way."
"content_body": "I'm floating in a most peculiar way.",
"room_id": "!slw48wfj34rtnrf:example.org",
"prio": "high",
"unread": "2",
Expand Down
14 changes: 9 additions & 5 deletions sygnal.yaml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ apps:
# # This allows you to specify additional options to send to Firebase.
# #
# # Of particular interest, admins who wish to support iOS apps using Firebase
# # probably wish to set content_available, and may need to set mutable_content.
# # (content_available allows your iOS app to be woken up by data messages,
# # and mutable_content allows your notification to be modified by a
# # probably wish to set content-available, and may need to set mutable-content.
# # (content-available allows your iOS app to be woken up by data messages,
# # and mutable-content allows your notification to be modified by a
# # Notification Service app extension).
# #
# # See https://firebase.google.com/docs/cloud-messaging/http-server-ref
Expand All @@ -240,5 +240,9 @@ apps:
# # be overwritten or lead to an invalid request.
# #
# #fcm_options:
# # content_available: true
# # mutable_content: true
# # apns:
# # payload:
# # aps:
# # content-available: 1
# # mutable-content: 1
# # alert: ""
22 changes: 22 additions & 0 deletions tests/test_gcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def _get_access_token(self) -> str:


class GcmTestCase(testutils.TestCase):
maxDiff = None

def config_setup(self, config: Dict[str, Any]) -> None:
config["apps"]["com.example.gcm"] = {
"type": "tests.test_gcm.TestGcmPushkin",
Expand All @@ -131,6 +133,17 @@ def config_setup(self, config: Dict[str, Any]) -> None:
"api_version": "v1",
"project_id": "example_project",
"service_account_file": "/path/to/file.json",
"fcm_options": {
"apns": {
"payload": {
"aps": {
"content-available": 1,
"mutable-content": 1,
"alert": "",
},
},
},
},
}

def get_test_pushkin(self, name: str) -> TestGcmPushkin:
Expand Down Expand Up @@ -231,6 +244,15 @@ def test_expected_api_v1(self) -> None:
"missed_calls": "1",
},
"android": {"priority": "high"},
"apns": {
"payload": {
"aps": {
"content-available": 1,
"mutable-content": 1,
"alert": "",
},
},
},
"token": "spqr",
}
},
Expand Down
Loading