Ios app crashes on reuse after sitting idle

I have an ios app that I have running but if I leave it open and not running for more than 5-10 min, when I go to use it again it crashes. Is there an error log somewhere on the iphone or how would I set up to see one. Or if anyone has any ideas that would be great. The app is connected to Valentina SQL server. I have a related/similar app that runs on the desktop that doesn’t have these issues.

Do you have any code in App.UnhandledException?

If you don’t, I recommend using Sentry.io with Xojo_Sentry

It looks like the app is losing connection to Valentina SQL server when in the background and you aren’t checking for that when app is re-opened.

When you plug your iPhone to your Mac and open Xcode > Window > Devices and Simulators
you can see the recent logs from your iPhone.

1 Like

I do not, I’ll check that out. I’m not closing and reopening but just trying to click any button on it after sitting idle and it crashes. If I close it, the next time I open it is fine.

Sharon

what platform should i pick in sentry,io when creating a project - I don’t see any entry for xojo, should I pick ios?

Yes, iOS.

Then copy the Sentry DSN url to use that in your xojo app.

Thanks - It looks like I’m having issues with the database staying open…I’ll reach out to Valentina

1 Like

If your app is in the background then Apple may close some or all of its open files, sockets, etc. you should be handling these cases explicitly in your app with error handling in case a connection is closed while in the background. Most likely it’s not going to be a Valentina issue I would guess