Flutter Realm - How to keep alive session after on app was killed

Hello all, sorry if the question was already asked (not able to find a response).

Do it exist a way to keep alive a session even if the user kill the application ? Because if my understanding is correct, we have to login with the right provider when the user will open again the app. The only solution I see is to store credentials somewhere (Store Secure for example) and then perform the app.logIn() when the app is opened. But is it working with the Apple ID token for example ? I don’t want to force the user to connect each time. I have the feeling to miss something.

Can someone help me to understand ?
Thanks in advance

You can just ask the app instance like:

var user = app.currentUser;
if (user == null) {
  // only need to do the login here
}

The app will remember the currently logged in user across app restarts, so it will only be null if he never logged in.

I tried, if the app is closed and reopened the currentUser is not null but If I kill the instance of the app, on relaunch the currentUser is null. I did my test with the project example:

return runApp(MultiProvider(providers: [
    ChangeNotifierProvider<AppServices>(create: (_) => AppServices(appId, baseUrl)),
    ChangeNotifierProxyProvider<AppServices, RealmServices?>(
        // RealmServices can only be initialized only if the user is logged in.
        create: (context) => null,
        update: (BuildContext context, AppServices appServices, RealmServices? realmServices) {
          // Here the currentUser is null on app instance killed and relaunch
          return appServices.app.currentUser != null ? RealmServices(appServices.app) : null;
        }),
  ], child: const App()))

You got any update for this?