-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[firebase_messaging] FCM custom sound on Android API level >= 26 it seems it doesn't work #523
Comments
The issue at flutter/flutter#26005 has been closed and moved here. Future collaboration on this issue will be done here. |
Hi @shadowsheep1 |
Hi @iapicca . I didn’t try the workaround ‘cause, well, it’s a workaround. And I did’t try with the latest version ‘cause the need for the custom sound wasn’t mine but it’s of the SO question’s OP. So if you tell me that this issue has been solved I believe you [-; |
any solution for that? |
Hi @lyseiha |
"[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.6 18G95, locale en-IN) [!] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 11.2.1) [!] Android Studio (not installed) [✓] Connected device (2 available) ! Doctor found issues in 2 categories." I don't know why it shows Android Studio is not installed, I am working on Android Studio only
|
and if you say sound should come in 'notification' the how I can do that with FCM console? |
I added these code in MainActivity.kt in onCreate()
and the payload I used : "notification": { I already got the custom sound for android api level > 26 . Put this here if someone needs. |
import android.app.NotificationChannel class MainActivity: FlutterActivity() {
} }
|
This comment has been minimized.
This comment has been minimized.
Its working guys thanks! |
is anybody has a java example like this code? |
A java version of this:
|
thanks, it's work |
It worked well!. Thanks. |
Where is MainActivity.kt? I only found one with thiis content: `package com.example.app_notify import androidx.annotation.NonNull; class MainActivity: FlutterActivity() { ` is this right? |
I tried your examples but get
|
error: expected |
I get the problem when building an apk and installing it on the phone. I have no problems at all with custom sounds when running the app with UPDATE: |
In my case event the default sound is not working on Android devices, on iOS it is working good. |
Does it right if I write like this one below?
here is my full MainActivity.java code.
It still doesn't work at my case |
After the flutter embedding v2 Here is the code (the full MainActivity.java) that I used that worked for me:
With the following in the notification:
and the file test1.mp3 in the res/raw folder |
This really helped a lot |
Really helped a lot |
ISSUE: unable to play custom sound when getting fcm in background of ionic app ---following is my node code----
----Following is my ionic code----
----Following is XML File code---- And i have place police_siren.mp3 file in assets/sound/ and also in res/raw directory. Please somebody help me figure out what im skipping in this, |
can I ask, is sound using .mp3 or not? OR "notification": { |
hello any news with this issue? |
If you want to use custom sound..you should use onesignal with
firebase....its best solution i came with
…On Thu, 5 Nov 2020, 12:29 pm evripidesk, ***@***.***> wrote:
hello any news with this issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#523 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMMTO6IOP5ZOJVMDXDBKEK3SOJEMBANCNFSM4JAIC6FQ>
.
|
harinderorg@gmail.com is my email, you can contact me there or on whatsapp +919417375191 for any help |
i have setup custom sound for android and ios app |
Hey all 👋 As part of our roadmap (#2582) we've just shipped a complete rework of the If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here. Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin. Thanks everyone 🤓 |
It has been a long time! 🚀🎉😉 |
I tried the firebase_messaging 8.0.0 dev 8 and the custom sound on android still not working |
Answering this SO question it came out that on devices running Android API level >= 26 push notification custom sounds it doesn't work, but the default sound it's played. All works fine on devices running Android API level < 26.
This the notification payload used during testing:
This my
flutter doctor -v
Had we missed something?
The text was updated successfully, but these errors were encountered: