Skip to content

Add default sound to iOS push payload - #107

Merged
requilence merged 1 commit into
mainfrom
ios-push-default-sound
Aug 25, 2026
Merged

Add default sound to iOS push payload#107
requilence merged 1 commit into
mainfrom
ios-push-default-sound

Conversation

@requilence

Copy link
Copy Markdown
Contributor

Summary

  • iOS push notifications arrive silently. The APNs payload built by buildFcmIosMessage sets only mutable-content: 1, and the Firebase Admin SDK omits the sound key entirely when Aps.Sound is empty — so the delivered notification has content.sound == nil and iOS plays nothing.
  • Nothing sets it on the client either: the iOS notification service extension mutates body, userInfo and badge but never sound, and iOS has no per-app sound default to fall back on. Android is unaffected because it receives a data-only message and builds the notification itself, where the NotificationChannel supplies the sound.
  • Setting it server-side rather than in the extension is deliberate: the extension is best-effort. On decryption failure, a missing encryption key, timeout or crash, the system falls back to the original payload — so the payload has to carry the sound for those paths to make any noise.

Payload before/after, verified against the Firebase SDK marshaller:

before: {"mutable-content":1}
after:  {"mutable-content":1,"sound":"default"}

buildFcmIosSilentMessage is intentionally untouched — that is the NotifyRead background push used to dismiss delivered notifications on other devices, and it must stay content-available only.

@requilence
requilence requested a review from cheggaaa August 25, 2026 16:41
@github-actions

Copy link
Copy Markdown

New Coverage 34.2% of statements
Patch Coverage 0.0% of changed statements (0/1)

Coverage provided by https://github.com/seriousben/go-patch-cover-action

@requilence
requilence merged commit 7cda755 into main Aug 25, 2026
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants