I've developed an app which receives push notifications from Parse. The app is designed to run in background so that notifications can be received even when app is closed.
But we are facing challenge with Huawei's devices due to its custom "power savings" feature which detects the app as power intensive and hence clears it from memory when screen is locked.
Are there any known methods to prevent the app from being restricted or to add it to "Protected Apps" list upon installation?
Note: We begun with GCM notificatoins, but after learning that GCM's notification deliverability is flaky, we moved on to Parse.com's PPNS and then this new roadblock.
We cant do much except detect the device,if device is huawei warn the user about propably issue if the desired app wont be added to protected apps hence this is the only way to do what we need.No other ways available and i reckon it will never be!
Related
I opened this question to ask you a strange thing that i'm facing currently.
I have various assumptions on what the problem could be, and i want to share them with you to get a confirmation.
I premise that my intent is not to use FCM. The application right now was a test to send a scheduled notification with the module "flutter_local_notifications". When the scheduled notification reaches the scheduled time, it fires if:
The application is open
The application is not open, but the smartphone is on
The application is on debug mode, is not open and the smartphone is off
I set on my smartphone some permissions for the application to ignore battery-saving mode, to enable autostart, lock the application to avoid the Android's memory management.
But still, when i turn off the screen of my smartphone the app's notification won't fire at the scheduled time.
I tried to do some tests on other smartphone's and the outcome is pretty different. For the other smartphones it works pretty well.
I am currently using a "Realme 8 5G", i was asking, is it possible to find a solution to overcome this problem or the problem is just out of my hands?
Thank you for reading and your time.
I have a App that i now wanted to expand with Silent Push Functionality for a customers Feature Request.
But now i encounter a rather strange behaviour(app freeze)
The Used Xamarin.Forms Version is 4.8.0.1451 (Updates did not solve the problem)
The Problem is Android Only related
Normal Notifications work as expected and dont produce any error
Here the quick Behaviour:
Receiving Silent Pushes works if the app is in Foreground (Multible times no limit)
Bringing the App to the Background and back to Foreground works also flawles
Do i Receive a Silent Push while the App is in Background or the Device is Locked and i bring back the App to Foreground/Unlock the device the app seems frozen (unresponsive and App.OnResume does not get executed)
(Also to note: i can only receive 1 silent push when the app is in Background/Device is locked)
For now i dont do anything on receiving the Silen push (to isolate this error)
Debug output aswell as LogCat does not provide any info what so ever.
i could not track any managed code that does execute and not return properly from some method calls
i can reproduce this problem on android 11(Pixel3) and android 9(Blackview A60)
I hope someone here has an idea what this problem could be.
It more informations or details are needed, i happily provide
In Android, starting in Android 8.0 (API level 26), an Android application no longer have the ability to run freely in the background.
When in the foreground, an app can start and run services without
restriction. When an application moves into the background, Android
will grant the app a certain amount of time to start and use services.
Once that time has elapsed, the app can no longer start any services
and any services that were started will be terminated. At this point
it is not possible for the app to perform any work.
For more details about this, you can refer to Background Execution Limits in Android 8.0.
We're currently running tests (that end in 2 weeks) with clients using an "older" version of our app.
The older app has a long-running scanner foreground service that will not restart on the MY_PACKAGE_UPDATE broadcast (wasn't implemented at the time). The new version of the app correctly handles this broadcast and restarts the scanning on MY_PACKAGE_UPDATE.
We need to roll out updates mid-test to fix a bug appearing on only some devices, and we are able to reach out to those specific users. The problem is that for any current users with auto-update turned on, their foreground scanning service will exit and not restart.
Am I correct that the MY_PACKAGE_UPDATE broadcast won't kick in yet? As in, it'll only begin working two updates from now?
Is there a way for me to turn off auto-updating for my app in the play store for all users?
Im developing a chat app which uses GCM to notify the user of incoming messages. One problem I can't seem to fix is that every manufacturer seems to implement his own battery saving in addition to the doze feature of Android. Most of the time a few apps get automatically put on the whitelist of these phones(like whatsapp).
As example Huawei uses "Protected Apps" and only if the user accepts my Intent which tries to add my App to the protected apps, only then my app works as expected.
Is there any way to get whitelisted or something like that for every manufacturer ? I can't believe I have to buy every phone on the market to test if somebody decided the doze feature is not enough.
Best Regards!
Here is the thing, I am not used to the latest android yet and the new system is giving me some confusions. Usually, for the older androids, if I close all background apps, I won't get new notifications from them. But after switching to a new phone with the latest android, I realized that even if I do close all background apps, I still keep getting notifications from them. So, how are the apps still pushing notifications if I already close them from background?
(Say google maps for example, I am 100% sure I killed it in background but now it keeps notifies me about my live traffic status on my notification bar.)
So Here's the answer-
Yes, they are. Whenever the Internet is turned on or you get a message, listener of that app wakes up and check for any notification and if there is something new, it shows you the notification.
These apps keep running in the background if not put in sleep mode by your phone and use the resources.
Like you don't want to get notified by WhatsApp for a new message but the moment you change the network, unlock your phone again or turn the data on, an event listener will wake up and notify you of new messages.
Also, wake timers are used to notify you after some fixed time like after every 5 minutes.
This is the thing I hate the most.
Not promoting but here's the app - search play store for Shutapp - Real battery saver (Blocked from Play store a while ago and doesn't work anymore for "obvious" reasons). It will turn off all the background apps and you'll be amazed to see a long list on first use.
This will remove all the apps from background until you open them again. I use this app most of the time and it really works great.
Try this out.