Logging in/out in a Native app closes the app

0
As the title indicates, when I log in to or I log out of an account in my mobile app, the whole app closes and the next time I open it, the operation is in effect (both logging in and logging out). The Javascript Actions used for logging in and logging out are the same as in the Web app. P.S.: The operations work fine in Make it Native app, but when the application is built, it causes this problem.    
asked
1 answers
0

Hi Oussama, this happens because, in the built mobile app, the login/logout actions cause the app to reload or close, unlike in the web or Make it Native preview.

Why it happens:The native build handles session changes differently and may treat some JavaScript actions (like page reloads or window close commands) as app exits.

How to fix:

  • Avoid full app reloads or commands that close the app after login/logout.

  • Use navigation methods to redirect users without closing the app.

  • Ensure authentication updates finish before navigating.

  • Check your JS actions for any code that might close the app unintentionally.

  • Test with device logs to catch errors causing the app to close.

Basically, adjust your flow to prevent the app from closing after login/logout in the native build.

 

I hope this one helps you! :)

answered