Issue
When the app "an IP-Phone" is swiped out of the recent app settings, incoming calls are no longer signalized though push messages and the call can not received.
Analysis
When the "an IP-Phone" app is not active in the foreground, the app should register with the push server. The push server will wake up the app through Firebase and the call can be terminated. On the device, if another app is opened and if the app is still in the "recent apps" overview visible, registration with the push server is ok and incoming calls are coming through. However, if from the recent apps overview the app is "swiped to kill", the Android OS exits all processes, the app cannot register with the push server and does not react either to wake up messages.
Issue Detailing
Push Notifications are not working properly on specific Android phones. This issue is noticed only on phones by manufacturers like Xiaomi, Oppo, One Plus, Vivo, Lenovo, Huawei, Samsung, and a few others.
Why is this Happening and How do we fix it?
On Android, we have three buttons at the bottom as part of the Navigation Bar. The square button opens the Recents screen on click. The Recents screen lists all the ongoing tasks or apps recently opened. We can clear these applications at any time.
Some Android phones running the app "an IP-Phone" are not receiving Push Notifications anymore when this app is cleared from Recents screen. The reason is that phone manufacturers like Oppo, Xiaomi, and One Plus exit the app completely and do not restart the background services for "an IP-Phone" and other apps. But these background services are necessary to receive the PUSH messages. The intentions of the manufacturers are to conserve battery and improve performance.
It is possible through the settings page to enable the re-starting of background services. Although the auto-starting of background services are disabled by default, users can manually enable this feature by following some instructions.
Why don’t Apps like Gmail and Slack have these Problems?
Top-popular apps like Gmail, Slack and Whatsapp are whitelisted by these manufacturers. That means these apps have auto-launch enabled for them by default. Most apps have auto-launch disabled by default.
Find the Settings to enable Auto-Launch. Where are they located?
The steps to enable auto-launch for an app are different for different manufacturers. It should also be noted that the terminology used by each manufacturer is different. The auto-launch feature can be referred to as app auto-start, start-up manager, auto-start manager, app optimization, protected apps, or background app management. To make matters even worse, the auto-launch settings page is not easy to find.
What’s the Solution?
In the end, the user will have to perform the steps manually. Here some guidelines for different phone devices!
Fore more information see this site.
IMPORTANT NOTE:
The exact steps for this process will vary depending on the device model. We recommend using the information here as a starting point. Some Googling with the precise model details should find instructions specific to the device.
Xiaomi
Enable autostart for the app:
Open up "Security" and click through to "Permissions" and "Autostart". Make sure that "an IP-Phone" is enabled.
OnePlus
Make sure the app is in the auto-launch list. Open up "Settings" and click "Apps", then "gear icon " and then "Apps Auto-launch". Find "an IP-Phone" in the list and toggle it on to enable auto launch.
Oppo
Make sure the app is on the list of allowed start-up apps. Open "Security Center", click "Privacy Permissions", then "Startup Manager" and then allow "an IP-Phone" app to start-up in the background.
Vivo
Enable the auto-start setting for the app. Open "i Manager", click "App Manager", then "Autostart Manager" and then allow "an IP-Phone" app to auto-start in the background.
Lenovo
Enable the auto-start setting for the app. Open "Settings" and click "Power Manager" and then "Background App Management". Flip the "Allow Auto-Start" toggle for the "an IP-Phone" app.
Huawei
Make sure the app is on the list of protected apps. Open "System Settings", then "Advanced Settings", then "Battery Manager" and finally "Protected Apps". Enable the toggle next to "an IP-Phone" to allow it to keep running even after the screen is turned off.
Samsung
If the app is running on a Samsung device, there are a few steps to take for switching off the battery optimisation the "an IP-Phone" app.
- Open "Settings", then "Apps", then the "three dots" on the upper right corner, then "Special Access", then "Optimize Battery Usage". From here, tap on the dropdown menu that says "Apps not optimized", then switch it to "all apps" and then switch off battery optimisation for the "an IP-Phone" app.
- Exclude the app from any of the battery optimization features on the device. These features are found in "Settings", then "Battery". Disable battery optimization for the app, as well as checking to make sure the "Restrict background data" setting is disabled.
Devices using Marshmallow OS or above (Android 6.0+)
If he problem still persists, try making sure that the app is not optimized for the "Doze" feature (battery saving). This setting is found on most devices by clicking "Settings", then "Battery", and then "Battery Optimization". Make sure that the app "an IP-Phone" is on the list of apps excluded from this optimization.
Specific solution for OPPO A57
How to get Push working if the app is swiped from the recents app:
- Open the security center on OPPO A57. Make sure the relevant app (“an IP Phone” or any of our white label apps) is on the list of allowed start-up apps. Open "Security Center", click "Privacy Permissions", then "Startup Manager" and then allow the app to start-up in the background.
Now the push service needs to be activated on the app itself. With the "an IP-Phone" client open, click on the “back” key and check that the green notification button in the status display is changing to grey after a couple of seconds (see screenshots below). This is the confirmation that the direct registration of the device has been taken over by the push server.
Now, the app can be swiped from the "recent" app screen and incoming calls are still displayed. PUSH messages are received by the device.
What will NOT work!
- If the app is swiped directly out of the recent apps, PUSH messages will not work. Never!
- If not enough time is waited to allow for the activation of the push service (step 2) and swipe the app too quickly from the recents apps (before the status button turns grey), PUSH messages will not work. Never!