i am building application using Flutter, GraphQL and Firebase with NodeJS API. In my applicaiton i have implmented Firebase auth and token refresh and my nodejs api validates it. My token refresh is with intervals of 3500 seconds (where token is valid for 3600). However in some situation (i do not kno why) after i am leaving app open for half a day i am starting to receiving message from token validation that i have to refresh token (not sure how to catch it because while testing intervals refresh works just fine)...
So what is most common way to refresh token in apps? maybe apps are automatically hybernated while inactive and refresh timers stopped? If yes - than what event should i use to to catch app became active again?
Thanks
p.s. After some research i realised what is the problem with token refresh in interval - while phone is active refresh interval works fine. If I lock phones screen time interval stops. After oepning phone again time interval starts again FROM BEGINNING. Here main problem occurs - since FB token is valid for 1 hour so there is 99% that iser will turn his phone screen of and after he turns it again timer will start from the beginning - but token will be expired...
Do you know any flutter events that are triggered after phone / app become active again?