fix: FCM data-only push so Seaca controls sound (0.9.6)

Send title and body in the data payload instead of notification block so
onMessageReceived always runs and the app can honour silent mode in background.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-06-11 10:03:28 +10:00
parent 3f7095ed03
commit 3f671b9899
4 changed files with 42 additions and 5 deletions
+5 -2
View File
@@ -141,13 +141,16 @@ def _send_fcm_data(
}
errors: list[str] = []
# Data-only: Android always calls SeacaMessagingService.onMessageReceived so the app
# can honour per-device notification mode (sound / silent / off).
message_data = {**data, "title": title, "body": body}
with httpx.Client(timeout=12.0) as client:
for token in tokens:
payload = {
"message": {
"token": token,
"notification": {"title": title, "body": body},
"data": data,
"data": message_data,
"android": {"priority": "high"},
}
}