Mobile browser weirdness

I have a simple messaging app that works in the browser, and I have a “read” field for each message to time-stamp it when it is read. I am setting the timestamp on the message in that page with a data change trigger (when the message count in the thread changes).

I assumed that, if the page is open, received messages will be marked as read, and if not, they will not be marked as read since the code in that page won’t be running.

But something interesting happens when I test it in Safari on iOS: even though the browser isn’t open, messages are still marked as read. There seems to be a background refresh happening on that page, and the code is being executed, even when Safari isn’t open.

If I reopen Safari, close that page, then close Safari, it works as expected.

Anyone had a similar issue? Any way I can prevent mobile Safari from updating the page and running the code in that page when the user navigates away from the app?


This topic was automatically closed after 70 days. New replies are no longer allowed.