3
Under Review

Detect if a device is either online or offline

It would be nice to have an API to be called that detects wether a device is online or offline, so that we can do further actions only if a device is actually connected to the internet and ready to perform actions

3 replies

What actions exactly do you have in mind? thanks

LD

I've created a workflow that changes my wallpaper every hour, on every device I own (through Join API calls). Now if one of the devices is turned off or not connected to the internet, the first time it gets online, all of the API calls get called, one after the other. It might be ok for notifications, but in my case it would download many images for no reason. I would then implement something that works like this:

- Every hour, check which devices are online
- Call the API to update the wallpaper only for the connected devices

So in practice you'd like an API call that tells you if the device is online?

LD

Exactly.. I don't know if that's possible, but I think it would work like an Ajax call with success/failure callbacks after a defined timeout. So if a device responds in the given timeout, consider it online, otherwise offline.

Unfortunately that's extremely expensive to do server side, sorry :( I don't think this one's doable.

LD

I get it, I couldn't quantify the effort needed to implement it, so I just proposed it :)