Skip to content

iOS push notifications have no sound - missing sound field in FCM/APNs payload #184

@zip085

Description

@zip085

Problem

Push notifications on iOS arrive silently (banner appears, no sound). All settings enabled:

  • Admin dashboard: "Enable Push Notifications" — ON
  • App profile: "Enable Notifications" — ON
  • iOS Settings → Databag → Notifications → Sounds — ON

Root Cause

In net/repeater/internal/api_notify.go, the FCM message is sent without platform-specific configuration:

notification := &messaging.Notification{ Title: msg.Title, Body: msg.Body }
message := &messaging.Message{
    Notification: notification,
    Token:        msg.Token,
}

Per Apple documentation, iOS requires an explicit "sound" field in the APNs aps payload to play a notification sound.
Without it, notifications are delivered silently.

References:

Suggested Fix

In net/repeater/internal/api_notify.go, replace the message construction (around line 44) with:

notification := &messaging.Notification{ Title: msg.Title, Body: msg.Body }
message := &messaging.Message{
    Notification: notification,
    Token:        msg.Token,
    Android: &messaging.AndroidConfig{
        Notification: &messaging.AndroidNotification{
            Sound: "default",
        },
    },
    APNS: &messaging.APNSConfig{
        Payload: &messaging.APNSPayload{
            Aps: &messaging.Aps{
                Sound: "default",
            },
        },
    },
}

All struct types (AndroidConfig, AndroidNotification, APNSConfig, APNSPayload, Aps) are from the firebase.google.com/go/v4/messaging package already imported in the file. No new dependencies required.

Additional Notes

  • A Payload struct with a Sound field is defined in net/server/internal/api_setPushEvent.go but is dead code — never used in the actual push flow
  • The real push path is: SendPushEvent() → HTTP POST to repeater.coredb.org/notifyNotify() in repeater → FCM SDK
  • Previously reported in Discussion Feature Request: iOS App Notification Sound #20. A fix was committed but the issue persists on balzack/databag:latest as of Feb 2026

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions