Push notifications...
-
Hi kl3m3m,
I have one more somewhat innocent question, I don't understand Android, as such, I don't know if it is possible.
Unfortunately it still happens that Gui-O gets freezed and then doesn't send any Push notification. I know this is a matter of Android "killing" apps that run in the background. When I check this situation, I go to settings, Applications, select Gui-O and confirm the "Force stop", from then on Gui-O works normally again, if I open the App it sends Push notifications again.
The question is if there is any way for Gui-O to periodically check if it is frozen and if so, automatically force stop and restart again.
As I say, this is a bit of a strange question, but in my view, Push Notifications are a big Pro of Gui-O and as such, any efforts to improve it is well appreciated.
Best regards
-
@Sato Hi!
To achieve reliable push notifications (reliable in a sense that Android "out of memory killer" does not kill the service) is not a simple task in GUI-O scenario... I will explain this in a bit.
But first - tell me when GUI-O freezes? Can you exactly describe the scenario when this happens? Let's try to solve this problem first! I would like to reproduce it, if I can on my device(s).
Back to the push notifications. I have created the GUI-O "push notification" service so it works the same way as regular IoT messages - no additional steps are required from the microcontroller developer side. But the problem here is that the Android OS can kill the service, even if it is in the foreground. There are of course some rules, which apps get killed first, but in general Whatsapp (for example) can also be killed by the Android OS. But in this case, when new push notification arrives, the Whatsapp service is restarted by the Android OS.
NOTE: This is based on my understanding and knowledge of Android apps and services, so this might not actually be 100% true!
I can try to implement "true" push notifications (through FCM - Firebase Cloud Messaging), but I must do some research on how the push notifications are then sent to a specific device (probably through some REST APIs with specific device id).
I will do some research, but this will take some time as the topic is fairly new to me.
Best regards,
kl3m3n -
Hi @kl3m3n,
I have so far been unable to reproduce or verify any pattern. What is certain is that now it doesn't happen as often as it did a few months ago.
Of course, I understand that it is not easy. Notifications being a strong feature, if you get better, maybe researching how WhatsApp restarts in case it gets frozen is already a step towards a solution.
I apologize for being a nag, but it's in a good way.Best regards