How to detect when app is minimized? Handling real time messaging

I have two parts to the question.

I’m testing an app that is somewhat real time messaging which hits the database every few seconds to check for new messages.

When i minimized the app, it’s continuing to hit the database. I’m not sure how this can scale properly with multiple users.

  1. Is this common with apps? How do other apps handle this.
  2. Is there anyway I can detect when an app is minimized and potentially reduce the calls.

I would recommend pause and resume handlers. See the Platform docs.

1 Like

Hmm I’m running ionic react. In the platform docs for the react section they don’t show pause or resume events being in the docs: