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

Notification not getting received in Android 31 #293

Open
manojsachdeva opened this issue Nov 13, 2022 · 25 comments
Open

Notification not getting received in Android 31 #293

manojsachdeva opened this issue Nov 13, 2022 · 25 comments

Comments

@manojsachdeva
Copy link

After making changes suggested by marutifh in Pull Requests, Build goes successful but notifications not received. However, Token is received just fine. Tried via Firebase Console as well as API

@michal-kroliczek
Copy link

I have exactly the same issue and already spent 8 hours to find what is wrong. Notifications work when app is in foreground, but when background, no notification is showed.

I updated to Cordova 11 and Android 11. Tried to build with OpenJdk11 and Oracle JDK 11.

Please help. It is urgent as now SDK 31 is required when uploading to store.

@yamnakhalil
Copy link

I have exactly same issue . Notifications work when app is in foreground, but when background, no notification is showed.
I updated to Cordova 11 and Android 11. Tried to build with OpenJdk11 and Oracle JDK 11.

Please help. It is urgent as now SDK 31 is required when uploading to store.

@yamnakhalil
Copy link

please respond asap the suggested change require

@michal-kroliczek
Copy link

michal-kroliczek commented Nov 24, 2022

You have to use newer Firebase SDK to comply with Android changes required about intents.
Original repo is not maintained anymore.

Here is a fork done. It contains update and it is working for me.
#277
Please follow comments. Basicly you need to remove plugin and add it this way:
cordova plugin add https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated

@yamnakhalil
Copy link

yamnakhalil commented Nov 24, 2022 via email

@yamnakhalil
Copy link

yamnakhalil commented Nov 24, 2022 via email

@yamnakhalil
Copy link

yamnakhalil commented Nov 25, 2022 via email

@michal-kroliczek
Copy link

Then you did not install plugin from fork.
You should have have following config:
image

@yamnakhalil
Copy link

yamnakhalil commented Nov 25, 2022 via email

@yamnakhalil
Copy link

yamnakhalil commented Nov 25, 2022 via email

@kotran88
Copy link

kotran88 commented Jan 5, 2023

same problem not working any in background after change 30 to 31

@flyingcat42
Copy link

flyingcat42 commented Jan 10, 2023

Notifications started working @michal-kroliczek @marutifh. I started using getInitialPushPayload() to retrieve the tapped notification.

cordova plugin remove cordova-plugin-fcm-with-dependecy-updated

cordova plugin add https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated --variable ANDROID_DEFAULT_NOTIFICATION_ICON="@mipmap/ic_launcher" --variable ANDROID_FCM_VERSION="23.0.0" --variable ANDROID_FIREBASE_BOM_VERSION="29.0.1" --variable ANDROID_GOOGLE_SERVICES_VERSION="4.3.4" --variable ANDROID_GRADLE_TOOLS_VERSION="4.1.0" --variable IOS_FIREBASE_MESSAGING_VERSION="~> 7.4.0"

Note: We are not simply removing and re-adding the plugin. We are adding marutifh's fork.
Thanks guys

@ErxrilOwl
Copy link

Notifications started working @michal-kroliczek @marutifh. I started using getInitialPushPayload() to retrieve the tapped notification.

cordova plugin remove cordova-plugin-fcm-with-dependecy-updated

cordova plugin add https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated --variable ANDROID_DEFAULT_NOTIFICATION_ICON="@mipmap/ic_launcher" --variable ANDROID_FCM_VERSION="23.0.0" --variable ANDROID_FIREBASE_BOM_VERSION="29.0.1" --variable ANDROID_GOOGLE_SERVICES_VERSION="4.3.4" --variable ANDROID_GRADLE_TOOLS_VERSION="4.1.0" --variable IOS_FIREBASE_MESSAGING_VERSION="~> 7.4.0"

Thanks guys

I tried this, but notif for background/foreground still not working.

@flyingcat42
Copy link

I tried this, but notif for background/foreground still not working.
For foreground: Inspect your cordova app with Chrome Inspector and try to shoot a notification (by pasting some code into the console) from there. Do you get any errors?

@ErxrilOwl
Copy link

I tried this, but notif for background/foreground still not working.
For foreground: Inspect your cordova app with Chrome Inspector and try to shoot a notification (by pasting some code into the console) from there. Do you get any errors?

I resolved it already. It turns out that I needed to remove the platform and add it again. Now it works. Thanks.

@redouanekahlioui
Copy link

It worked perfectly for me, thanks.

@Winicios-Mauri
Copy link

Winicios-Mauri commented Jul 13, 2023

I'm facing this error, I've tried to follow some steps that I found in some posts but it didn't solve it

FCMPlugin: Support for Gradle v4 or lower is deprecated. Please upgrade to a newer version.                
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/

@alitalaee
Copy link

Notifications started working @michal-kroliczek @marutifh. I started using getInitialPushPayload() to retrieve the tapped notification.

cordova plugin remove cordova-plugin-fcm-with-dependecy-updated

cordova plugin add https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated --variable ANDROID_DEFAULT_NOTIFICATION_ICON="@mipmap/ic_launcher" --variable ANDROID_FCM_VERSION="23.0.0" --variable ANDROID_FIREBASE_BOM_VERSION="29.0.1" --variable ANDROID_GOOGLE_SERVICES_VERSION="4.3.4" --variable ANDROID_GRADLE_TOOLS_VERSION="4.1.0" --variable IOS_FIREBASE_MESSAGING_VERSION="~> 7.4.0"

Note: We are not simply removing and re-adding the plugin. We are adding marutifh's fork. Thanks guys

Hello bro i tried this forked but i have a problem, i am using ionic version 7 and FCM use @ionic-native/core when i install it then cant add ionic cordova platform add android@11

**Project Info **
"@ionic/angular": "^7.0.0"
"@angular/core": "^16.0.0"
11.0.0 (cordova-lib@11.1.0)

Can you help me please

@alitalaee
Copy link

any help?

@eae1991
Copy link

eae1991 commented Sep 5, 2023

Hello guys, as of android 13, target sdk 33, this fork is not working anymore, notifications are not received in android neither background nor foreground. I have already solved for android 12 with the below solution but after updating android to 13 the issue reappears again. Did anyone faced it with the new android version? and how can we solve it?

Notifications started working @michal-kroliczek @marutifh. I started using getInitialPushPayload() to retrieve the tapped notification.

cordova plugin remove cordova-plugin-fcm-with-dependecy-updated

cordova plugin add https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated --variable ANDROID_DEFAULT_NOTIFICATION_ICON="@mipmap/ic_launcher" --variable ANDROID_FCM_VERSION="23.0.0" --variable ANDROID_FIREBASE_BOM_VERSION="29.0.1" --variable ANDROID_GOOGLE_SERVICES_VERSION="4.3.4" --variable ANDROID_GRADLE_TOOLS_VERSION="4.1.0" --variable IOS_FIREBASE_MESSAGING_VERSION="~> 7.4.0"

Note: We are not simply removing and re-adding the plugin. We are adding marutifh's fork. Thanks guys

@YaroslavG
Copy link

@alitalaee @eae1991 do you have any updates about this issue?

@eae1991
Copy link

eae1991 commented Jan 4, 2024

@alitalaee @eae1991 do you have any updates about this issue?

No updates at all on this issue, please if you find anything keep me posted thank you.

@YaroslavG
Copy link

YaroslavG commented Jan 4, 2024

@alitalaee @eae1991 do you have any updates about this issue?

No updates at all on this issue, please if you find anything keep me posted thank you.

You can try this plugin
https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated
It works for Android 13 and target SDK 33 but if you using ionic v7 I created a fork which success for me:
https://github.com/YaroslavG/cordova-plugin-fcm-with-dependecy-updated

@eae1991
Copy link

eae1991 commented Jan 4, 2024

@alitalaee @eae1991 do you have any updates about this issue?

No updates at all on this issue, please if you find anything keep me posted thank you.

You can try this plugin https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated It works for Android 13 and target SDK 33 but if you using ionic v7 I created a fork which success for me: https://github.com/YaroslavG/cordova-plugin-fcm-with-dependecy-updated

I am using ionic v4, and it's a hassle for me to upgrade to v7, your fork only works for ionic 7?

@YaroslavG
Copy link

@eae1991 I think yes, you can try it. This also must work for ionic v4

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

No branches or pull requests