Can't read pin with API when app is not active

Hi there. Not sure wether this is an issue, or not, but here is the case:
I have arduino uno r3 connected to PC with USB. Phone app and API requests works fine, in case both blynk app and phone screen is on. But when I trying to read pin with API without app, it returns the last value.
API URL looks like this: http://blynk-cloud.com:8080/token/get/D4
[PhoneScreen = on]
ButtonPressed => api returns [“1”]
ButtonNotPressed => api returns [“0”]
ButtonPressed => api returns [“1”]
[PhoneScreen = off]
ButtonPressed => api returns [“1”]
ButtonNotPressed => api returns [“1”]
ButtonPressed => api returns [“1”]

Is this by design, or some kind of glitch?

Hi. Who changes value of button? After app goes offline?

Me. Actually, this isn’t a button. I use IR sensor, but it almost the same in this case.

I mean. Pin state changes on hardware side in that case?

yes

In that case that’s ok. As digital pins status change is not transferred to server. You have to use virtual pins for that. And in code send pin state change to server.

Oops, my bad. Thanks for help =)

2 posts were split to a new topic: When phone enters screensaver, PHP program calling Blynk Server API stops updating