Skip to content

Commit

Permalink
notif: Use Zulip's notification sound on Android
Browse files Browse the repository at this point in the history
Updates: zulip#340
  • Loading branch information
rajveermalviya committed Aug 23, 2024
1 parent 57a5769 commit 47cd69c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Binary file added android/app/src/main/res/raw/chime3.m4a
Binary file not shown.
2 changes: 1 addition & 1 deletion android/app/src/main/res/raw/keep.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
https://github.com/zulip/zulip-flutter/issues/528
-->
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/zulip_notification"
tools:keep="@drawable/zulip_notification,@raw/chime3"
/>
6 changes: 4 additions & 2 deletions lib/notifications/display.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ AndroidNotificationHostApi get _androidHost => ZulipBinding.instance.androidNoti
/// Service for configuring our Android "notification channel".
class NotificationChannelManager {
@visibleForTesting
static const kChannelId = 'messages-1';
static const kChannelId = 'messages-2';

static const kDefaultSoundResourceName = 'chime3'; // 'Zulip - Chime.m4a'

/// The vibration pattern we set for notifications.
// We try to set a vibration pattern that, with the phone in one's pocket,
Expand Down Expand Up @@ -77,8 +79,8 @@ class NotificationChannelManager {
name: 'Messages', // TODO(i18n)
importance: NotificationImportance.high,
lightsEnabled: true,
soundResourceName: kDefaultSoundResourceName,
vibrationPattern: kVibrationPattern,
// TODO(#340) sound
));
}
}
Expand Down

0 comments on commit 47cd69c

Please sign in to comment.