Client: mirror branded notification sound to customer app
The customer app now uses the same halobestie_notif.ogg as the mitra app (shipped in the previous commit). Channel ID unified across both apps so backend FCM stops branching per recipient. - client_app: same channel bump (chat_messages → halobestie_chat_v1) + RawResourceAndroidNotificationSound binding, both at channel- create time and per-notification details. .ogg copied to client_app/android/app/src/main/res/raw/halobestie_notif.ogg (same 32 KB asset, identical file). - Backend: drop the per-recipientType channel ID branch; everyone targets halobestie_chat_v1 now. Verified on emulator-5554 (customer): dumpsys shows the channel bound to android.resource://com.mybestie/raw/halobestie_notif. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,11 +8,17 @@ class NotificationService {
|
||||
static final _localNotifications = FlutterLocalNotificationsPlugin();
|
||||
static GoRouter? _router;
|
||||
|
||||
// Channel ID bumped (`chat_messages` → `halobestie_chat_v1`) when the
|
||||
// branded notification sound was introduced. Android binds sound to a
|
||||
// channel at create time on API 26+, so an existing channel can't pick
|
||||
// up a new sound — a fresh ID is the only way. Backend FCM payloads
|
||||
// target the same ID — see backend/src/services/notification.service.js.
|
||||
static const _channel = AndroidNotificationChannel(
|
||||
'chat_messages',
|
||||
'Chat Messages',
|
||||
description: 'Notifications for incoming chat messages',
|
||||
'halobestie_chat_v1',
|
||||
'Chat HaloBestie',
|
||||
description: 'Notifications for incoming chat messages and pairing requests',
|
||||
importance: Importance.high,
|
||||
sound: RawResourceAndroidNotificationSound('halobestie_notif'),
|
||||
);
|
||||
|
||||
static Future<void> initialize(GoRouter router) async {
|
||||
@@ -60,6 +66,9 @@ class NotificationService {
|
||||
channelDescription: _channel.description,
|
||||
importance: Importance.high,
|
||||
priority: Priority.high,
|
||||
// API 26+ ignores this in favor of the channel's sound; included
|
||||
// for the API 24/25 path where channels don't exist yet.
|
||||
sound: const RawResourceAndroidNotificationSound('halobestie_notif'),
|
||||
),
|
||||
iOS: const DarwinNotificationDetails(
|
||||
presentAlert: true,
|
||||
|
||||
Reference in New Issue
Block a user