diff --git a/changelog.d/370.doc b/changelog.d/370.doc new file mode 100644 index 00000000..52ec60db --- /dev/null +++ b/changelog.d/370.doc @@ -0,0 +1 @@ +Update docs & tests to reflect APNs usage in FCM v1 API. diff --git a/docs/applications.md b/docs/applications.md index 2989a665..10cc39fd 100644 --- a/docs/applications.md +++ b/docs/applications.md @@ -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", diff --git a/sygnal.yaml.sample b/sygnal.yaml.sample index dd117418..1b59d4c5 100644 --- a/sygnal.yaml.sample +++ b/sygnal.yaml.sample @@ -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 @@ -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: "" diff --git a/tests/test_gcm.py b/tests/test_gcm.py index 023fae59..a5454937 100644 --- a/tests/test_gcm.py +++ b/tests/test_gcm.py @@ -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", @@ -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: @@ -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", } },