Internet button store button clicks when offline

I have an Internet button sending events to the cloud for each button click, and it will connect to wifi with weak signal. I’m wondering if there is a way to store button clicks on the photon when the photon is disconnected, so the events can be automatically send when the button got reconnected

Sure there is, you just need to ensure your code keeps running while disconnected by means of SYSTEM_THREAD(ENABLED).

Would also require the events to be queued until the internet/cloud connection was restored. Depending upon the event message and the number of messages when disconnected you could use the RK library- sendqueueasync (apologies - can’t remember the name but if you search for RK in libraries you will see it.)