Mitra: branded notification sound (halobestie_notif.ogg)
Drops the system notification ding for incoming mitra FCM (Curhat Baru,
Permintaan Perpanjang) and plays the HaloBestie audio mark instead.
Source: a 2.8s mono AAC inside a 3GPP container the user supplied;
converted to 32 KB OGG (Vorbis q5) for Android since the channel-sound
API needs `res/raw/<name>.<ext>` and OGG is the smallest universally
supported short-sound format on Android 5+.
- mitra_app: bump notification channel ID from `chat_messages` to
`halobestie_chat_v1` (Android binds channel sound at create time
on API 26+, so existing installs with the old channel need a fresh
ID to pick up the new sound — can't mutate in place). Bind
RawResourceAndroidNotificationSound('halobestie_notif') at both
channel-create time and per-notification details (latter covers
API 24/25 where channels don't exist).
- Backend: branch FCM `android.notification.channelId` by recipient
type — mitras → `halobestie_chat_v1`, customers → `chat_messages`
(unchanged). Customer app keeps system sound until/unless we ship
a customer-side sound too.
Verified on emulator-5556 via `adb shell dumpsys notification` — the
new channel resolves to
`android.resource://com.mybestie.mitra/raw/halobestie_notif`. The OGG
ships inside the APK (32092 bytes, confirmed via `unzip -l`).
Follow-up (iOS): bundle the same sound as `.caf` under ios/Runner +
register as a Runner-target resource in pbxproj + reference filename
in the APS payload. Deferred until iOS testing comes back into scope.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,14 @@ export const sendPushNotification = async (recipientType, recipientId, { title,
|
||||
|
||||
if (!user?.fcm_token) return false
|
||||
|
||||
// Mitra app ships a branded notification sound on its own channel
|
||||
// (`halobestie_chat_v1`, declared in mitra_app/lib/core/notifications/
|
||||
// notification_service.dart). Customer app keeps the legacy
|
||||
// `chat_messages` channel until/unless we ship a customer sound too.
|
||||
const androidChannelId = recipientType === UserType.MITRA
|
||||
? 'halobestie_chat_v1'
|
||||
: 'chat_messages'
|
||||
|
||||
try {
|
||||
await admin.messaging().send({
|
||||
token: user.fcm_token,
|
||||
@@ -33,7 +41,7 @@ export const sendPushNotification = async (recipientType, recipientId, { title,
|
||||
},
|
||||
android: {
|
||||
priority: 'high',
|
||||
notification: { channelId: 'chat_messages' },
|
||||
notification: { channelId: androidChannelId },
|
||||
},
|
||||
apns: {
|
||||
payload: {
|
||||
|
||||
Reference in New Issue
Block a user