Closed albertleao closed 1 year ago
Hello! I have the same problem. How did you fix this?
i have the same problem
I also have the same problem. Any update on this?
Any update? I have the same issue.
In my case, the problem was because I set custom icon options on PushNotification.init()
PushNotification.init(
{
"android": {
icon: "notification"
}
}
);
There 2 solutions for this case: remove the custom icon options from the function above or open the project in Android Studio and then create new icon assets from Image Assets Studio.
Bug Report
Push notification has been working for a while but background notifications have stopped. Foreground notifications working as expected.
I have
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_notification" />
And my res/drawable/ic_notification folder has icons generated by android studio
Expected Behaviour
Notification when the app is not in the foreground pops a notification in the status bar and android notification
Actual Behaviour
No notification but the following error in logs
Steps to Reproduce
Push notification when app is in background
Platform and Version (eg. Android 12.0)
Android 12
(Android) Device Vendor (e.g. Samsung, HTC, Sony...)
Samsung
cordova info
PrintoutCordova Packages:
Project Installed Platforms:
Project Installed Plugins:
Environment:
android Environment:
ERROR: Command failed with ENOENT: avdmanager list target spawn avdmanager ENOENT
ios Environment:
Xcode 13.4 Build version 13F17a
Project Setting Files:
<?xml version='1.0' encoding='utf-8'?>
--- Start of Cordova JSON Snippet --- { "plugins": { "cordova-plugin-statusbar": {}, "cordova-plugin-vibration": {}, "cordova-plugin-splashscreen": {}, "cordova-plugin-file-transfer-latest": {}, "cordova-plugin-file": {}, "cordova-plugin-keyboard": {}, "cordova-plugin-camera": { "ANDROIDX_CORE_VERSION": "1.6.+" }, "cordova-plugin-app-version": {}, "cordova-plugin-purchase": {}, "cordova-plugin-dialogs": {}, "cordova-plugin-exclude-files": {}, "cordova-plugin-device": {}, "cordova-clipboard": {}, "cordova-plugin-inappbrowser": {}, "@havesource/cordova-plugin-push": { "ANDROIDX_CORE_VERSION": "1.6.+", "FCM_VERSION": "18.+", "IOS_FIREBASE_MESSAGING_VERSION": "~> 6.32.2" } }, "platforms": [ "ios", "android" ] }
Sample Push Data Payload
Logs taken while reproducing problem