(SOLVED we think) Push notifications not received when blynk app is in sleep mode

I’ve scrolled through previous reports of push notification problems and tried some of the things that should have solved my issue e.g. uninstall the widget and reinstall.

I’m using latest version of android blynk. Using blynk server. Issuing notification from VB application code using HTTP call. Have the widget set to high priority.

I get the notification OK when blynk is running. When app is in sleep mode the notification is not waking the blynk app. When I wake the blynk app there is still no notification.

What is sleep mode?

my description of when the app is not loaded and visible as a running app on the android. I have swiped it away and need to tap on the blynk icon to see and use my project.

Im pretty sure the app won’t do anything unless it is running.

Like the way a computer can’t compute when it is switched off…

Yes, sleep mode is an accurate enough term, depending on app of course…[quote=“Dave1829, post:4, topic:11673, full:true”]
Im pretty sure the app won’t do anything unless it is running.
[/quote]

If an app is designed to “sleep” the background to some degree (aka notifications) then it is technically still running, just is a sleepier way :wink: I have a doorbell app that works that way.

While I haven’t needed to use Blynk notifications myself (aside from experimenting with email notifications), I am under the impression (from other topics, and watching my own experimental MCU sketches) that Blynk also stays somewhat active when in background.

@koaiwi Since someone will probably need to know… what make & model of phone and version of Android are you running. Are you running any battery saver modes on the phone, etc.

Other apps such as email, txt messaging, facebook messenger show notifications when not loaded.

I think the widget setting for high priority means that messages will be sent when the blynk app is not loaded and logged in.

see https://developers.google.com/cloud-messaging/concept-options#setting-the-priority-of-a-message

and see previous post [SOLVED] Problem with push notifications on Android
where there is a similar problem

This has been a problem in the past unless I am missing the point somewhere.

I do believe you need to at least keep logged into the app at all times to maintain any chance of notifications.

Gunner. I am using a Huawei p9 lite. The phone is only 5 ,months old and had an android update 4 weeks ago

I am still logged into blynk when laying it to sleep :slight_smile: .

No battery saver. Other apps are receiving stuff when they are asleep.

@koaiwi

I see there is a “built in” notification when hardware goes off-line option (in the notification widget)… have you tried shutting off your MCU to see if that notification works (or not) when your app is sleeping?

my Blynk app restarts after “swipe it to sleep” - so that is just my experience.

but i never tried ‘HIGH PRIORITY’ notifications…

Tried this too. The hardware down and push notifications both work when blynk is awake. Both don’t work when blynk is asleep.

I’m raising this as from what I can see the problem is similar or the same as that raised a year ago. It appeared to require a fix. Can someone have a look at it again please.

see Giải pháp gửi thông báo qua đám mây của Firebase  |  Firebase Cloud Messaging

The function is not as useful if it wont work when the app is asleep but maybe that is just the way it has to work. Can someone confirm one way ot the other. Thanks.

@BlynkAndroidDev

This issue seems to be in your line of understanding? Your assistance may be required again.

@koaiwi

I see you have removed and re-added the notification widget… have you tried uninstalling and reinstalling the whole app itself? Your projects are stored on the server, linked to your account email, so will be restored when you log in anew.

The previous issue also tried to uninstall and reinstall the app with no improvement. So I
think I will wait for @BlynkAndroidDev to have a look at the issue unless he too thinks I should try that or says this is just the way it has to be.

Ya, no sense in wasting a few clicks and less than 5 minutes to confirm :wink:

Thanks for your ironic response :slight_smile: .Being a grey beard programmer I’ve learnt to choose my battles and let the younger ones do some legwork. :slight_smile: I can wait.:sleepy:

No problem, it suits my personality at times :wink:

And being a mostly grey bearded technician, I know that value of process of elimination. And speaking of irony, removing and reinstalling the app may have even taken less time/effort than typing the post, stating that you are not going to remove and reinstall the app :stuck_out_tongue_winking_eye:

Was just trying to help, carry on.

@koaiwi could be your phone settings? Usually this is the case.

@Dmitriy do you know which ones in particular? If you know it will save me searching around.