Android removes my apps notifications when it creates more than 3 notifications.
This is not happening on all the phone, I can't even reproduce this on the emulator.
It is happening with my Moto G5S Plus running Android 7.1.1.
The error I am getting in the log is
NotificationService: Suppressing notification from package by user request.
The mentioned error comes if the user has disabled notification of the particular application,
to check weather notifications are allowed or not refer to this link
checking if notifications are enabled for specific package
Otherwise, you can manually enable notification of particular application from App Info settings
Related
Lenevo Mobile not receiving push notification when App is Closed/killed. I have analysed this issue for long time. Tried solutions like removing app from Optimize app List. etc. Please Help me out.
Lenovo/vivo and some other manufacturers have auto-start feature that disables most apps(except of whitelisted apps like facebook) to start in background, try giving your app permission to auto-start manually in settings
Firebase push does not work on some devices when app is closed with only data payload. See this thread: https://github.com/firebase/quickstart-android/issues/41
I know when app is killed by swipe then some OEM kill all the services of the app which directly effect FirebbaseMessagingService and due to this onMessageReceived() method never invoked. I have also tried with high priority FCM but sadly no success. Here are the phones on which I am facing an issue: OnePlus, Lenovo, Huawei.
Currently, I am testing with OnePlus 5, when I change the battery setting to "Don't Optimise" then push notification started working.
I killed the app and run dumpsys package MY-PACKAGE | grep stopped command and I found that app is not stopped. It shows stopped=false. It means app is running.
The concept of push notification is to notify users when app is closed but currently, we are unable to do.
Any suggestion how can I fix this?
FirebaseMessagingService can receive PushNotification even when app is closed/killed.
But there are some problems in the way. The behavior of the apps changes between development and production, and because of the device provider.
The first thing you have to consider, is when the app is in development, if you force close the app (kill-process), FirebaseMessagingService stop being triggered. But this doesn't happen in production, so don't be aware of this if your APK is signed. link to source
The second thing, is that there some Android phone providers that manage processes by them selfs. We can see an example like Huawei phones and their "Protected applications", which make user decide if want to protect the app or not. Only famous apps are protected on installation like WhatApp or Twitter... link to source
At this point, your FirebaseMessagingService should be triggered, but there are other problems related with memory and processes managed by system (OS). Your Service can be canceled because of the time that it's spending to handle the PushNotification. You can find many ways to handle this problem, but the best way, is Firebase JobDispatcher. link to source
I am using onesignal for android push notifications. But not all notifications are being sent. Sometimes notifications are sent while sometimes they are not.... Whats the problem? Please Explain.
the problem is not with the code because some notification get sent but most of them do not get sent.
There are a few more details that are needed to be able to diagnose this problem.
First, is OneSignal saying that there were any errors? If so, you can find the cause of the errors by visiting the settings page for your OneSignal app and selecting "Show details" next to any visible errors or warnings.
Next, if OneSignal is not showing 0 possible recipients then that means your device has not opted-in to notifications, or the device has uninstalled your app, or the OneSignal SDK was not properly installed in your app.
Finally, if OneSignal is showing that the notification was delivered but it was not received, the most common causes of this issue on Android devices are as follows:
The user has force-closed your app. (Notifications will not be delivered to apps that were force closed)
The user has denied notification permissions ( Check the notification setting under Settings > Apps)
App is closed on a Huawei or Xiaomi device due their custom Android tweaks.
a. Huawei - Go to Settings > "Protected apps", check your app.
b. Xiaomi - Make sure "Auto-start" property enabled for your app in the settings.
In app - A notification will not be displayed on the device if your app is currently in focus by default. However, you can call EnableInAppAlertNotification with true to show notifications as alert boxes in your app.
I have been testing my app on an Android 5 ZenFone 2. This phone contains a piece of Asus software called autostart manager.
Some detrimental scenarios for my cordova app:
After app is installed autostart manager automatically denies it autostart. The big problem here is that the app doesn't receive push notifications when it is neither running in foreground or background. If the user kills the app from task manager then no more notifications (unlikely what the user desires).
The app appears to be killed automatically a few mins after being placed in the background. I am assuming this is autostart trying to conserve memory. Again no push notifications.
My app is functionally reliant on being able to receive push notes when not in foreground.
I reckon most average users are not aware that their apps may not be receiving push and therefore not fully functional.
I am wondering:
Are there autostartmanager equivalents for other Android devices doing the same thing?
Is it possible to beat this software and allow push notification always to be received by editing manifest configuration?
I believe there is no way too make push notifications work unless you app is marked as "allowed" to start in the Autostart Manager.
There are a lot of app like the Asus Autostart Manager in the Play Store, but generally a user needs to explicitly install one, while the Asus one is preinstalled and non-removable (at least it starts again after the next update which happens quite often for Asus).
I was facing the same problem.
Go to -> Sound & Notification -> Notification access -> Enable for ZenUI Launcher.
Go to -> Apps and enable notificatio
Is there a way to find if the "Show notification" for app is enabled or disabled?
I have a requirement where I need to check and enable or disable notifications.
When you see the details of the any app, example in the link
http://www.trickyways.com/wp-content/uploads/2014/05/show-notifications-disabled.png
there is an option to disable notifications. Is there any function or method in Android with which I can extract this
I have seen articles that it can't be done for 4.0, wondering if there is any update for 4.4 and above
The solution is for API Level >= 18.
You can include NotificationListenerService in your project which allows you to listen to all the Notifications that are posted on the phone.
So whenever your application posts a new notification NotificationListenerService will get a callback. So, if you are posting a notification and NotificationListenerService is not getting a callback, it means user has blocked the notifications for your application.
Note that user needs to explicitly grant your application Notification Access Permission in order for your application to access the notifications.