Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a new notification channel is created, the existing notification sound changes. #1362

Closed
ilsong963 opened this issue Oct 30, 2021 · 2 comments · Fixed by #1379
Closed

Comments

@ilsong963
Copy link

I'm not good at English, so I ask for your understanding of using a translator.

my library version is
flutter_local_notifications: 4.0.1+2

I am using 6 notification channels and I am trying to create 2 notification channels.
However, when two are generated, the notification sound of the existing channel changes.

create chennel part in my code
const newOrderNotiChannel = AndroidNotificationChannel( 'noti_push_NEW_ORDER', // id 'noti_push_NEW_ORDER', // title 'neworder', // de sound: RawResourceAndroidNotificationSound('new_order'), importance: Importance.max); await flutterLocalNotificationsPlugin .resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>() ?.createNotificationChannel(newOrderNotiChannel);

send notification on server
const NOTI_FOR_NEW_ORDER = { notification: { title: "neworder", body: "neworder", android_channel_id: "noti_push_NEW_ORDER", sound: "NEW_ORDER.wav" }, data: { click_action: "FLUTTER_NOTIFICATION_CLICK", type: "NEW_ORDER" } };

when send notification value of android_channel_id as noti_push_NEW_ORDER,
The sound that plays is the basic sound or other custom sound (ex DONE_ORDER) but title body is right.
Ios have no problem. i think.. because it is handed over to the sound of payload.

While searching for this issue, the stackoverflow answer is write keep.xml, so this code is also written down.
<?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@drawable/*,@raw/new_order,@raw/hurry_order,@raw/checked_order,@raw/new_message,@raw/new_notice,@raw/test_alarm" />

If i send notification A, iwill hear notification B sound , and if isend notification B, i will hear sound C.

If the notification sound changes after release at google play, users will feel uncomfortable because there is no solution other than reinstalling the application and deleting data.

Is this a version issue? Or is there a solution?

@ilsong963
Copy link
Author

I found the same case in stackoverflow.
https://stackoverflow.com/questions/48781986/notificationchannel-playing-wrong-sound-in-oreo

my sound file name is "new_order", "hurry_order" ...
so I named the file I was going to add like "znew_order", "zhurry_order"

There's no more problem....
and i close this issue

@MaikuB
Copy link
Owner

MaikuB commented Nov 8, 2021

I'm reopening this as from the issue you've described, it looks like there's a valid problem to be addressed here where if the resource IDs change, a different sound could be played

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants