Whatsapp service restarts after force stop when push notification received - android

We are trying to understand the behavior of whatsapp service in Samsung S5 and above models. In these models whatsapp application is embedded to the ROM of the device, which you cannot uninstall it. Even I force stop the application, whatsapp service becomes running and displays the message when a push notification received.
I have tried it in Nexus 5 device on which whatsapp is not on ROM. In this case after force stop, whatsapp cannot receive push notification and service is still not running.
I am suspicious that Samsung has provided another privilege to whatsapp application. By the way we are registering to broadcastreceiver from Android manifest file.
Thanks in advance,

Apps that are installed under /system/app or /system/priv-app folders (most of the ROM bundled apps are in those folders and they cannot be uninstalled) can still receive push notifications even if they are force stopped by user.
So, it's not likely that Samsung gives some privilege to Whatsapp, but they've just bundled it with the ROM and put the apk into one of system app folders.

Android has made changes or restricted from Android 3.0 installed app has to be opened atleast once to start service or receive broadcast. , for 3rd party or installed application if the services are killed , the application should be opened at least once . So in case of Nexus 5 whats app is a 3rd party app , where as in Samsung it is a system app so it has permission to start service with out launching the application.

Related

Device Specific Issue in Receiving Push Notification when App is killed/closed

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 notification issue in Android when app is closed/killed

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

Broadcast and service not working after clearing my app from recent app manager

I am developing app like true caller. services and broadcasts working as per expectation in emulator but not working so well in my real device after clearing app from recent app.
I am using Redmi 1's. to test in real device.
when i clear app from recent app manager it not receive broadcast receiver and stop all services.
in the same device when i install truecaller it's working fine. when i check in
Setting->apps->running app there is true caller 1 process and 1 service always running in my device even after i clear it from recent app manager.
how to achieve this types of functionality which always receives broadcast even after app cleared from recent app manager?

Not receiving GCM push notification in MI phone if app is killed

I integrated GCM in my project to receive push notification from server. I am able to successfully receive push notification in all the devices (Nexus, Samsung etc), however, I am not receiving notifications on my Xiaomi MI phone.
When the app is running or is in background then I am receiving notification however if I kill the app (by swiping the app away from recent apps) then I don't receive any notification.
In pre-installed Security app there is an Auto-Start feature. Some apps have this auto-start feature turned ON and some don't. My app have this auto-start feature turned OFF. If I turn auto-start ON for my app then I start receiving notifications even if I kill the app.
How can I fix this issue? Please help me out.
Start AutoStart
Open Security App -> Permissions -> Auto Start Management.
Add/Enable your app as auto start apps
Start Lock Screen Notification
Open Settings App -> Notifications - Manage Notifications.
Tap on your App and select all cases.
i got success with this.. Hope it helps..

Android 5 Asus ZenFone 2 blocking push notifications when app close

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

Categories

Resources