App seems to restart after being backgrounded

I have an Expo app and I try to send push notifications to my release version while it’s backgrounded.
This works great for Android, but iOS does not appear stable.

It does work when the app is in the background for about a minute or two. After that, it does not seem to receive it anymore. Then when I open the app. It is showing my splash screen instead of the last page I was at. Indicating that my app is restarting. (Maybe it crashed)

Then the push token is changed. (Might explain how the push messages may not have been working)

I have no idea on where to start looking, since I cannot seem to find a related issue on SO/GitHub/Expo forums.

Any ideas on what this might be? Thanks!

Expo SDK: 40.0.0 (Bare Workflow)
React Native: 0.63.4
Platform: iOS (Release)
PNS: Firebase Cloud Messaging

EDIT: I used xcode to profile the memory usage, but that is inconclusive (16MB). Energy Impact is Low .

UPDATE:

Once I used Location.startLocationUpdatesAsync, the app never crashes anymore. This is weird behaviour to me. Is there a way to have this working without this background task?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.