Logout with native functions
If your app is configured to require users to log in before they can access the content, and you are already using the nativeFunctions.login() to log users in, you will want to implement the nativeFunctions.logout() function as well.
When triggered, the nativeFunctions.logout() will clear all cookies and sessions in the app, and reload the app, taking the user back to the login screen.
Imagine a situation where while browsing your app the user gets logged out because his cookies expired, if the nativeFunctions.logout() function is not triggered the user will see your website’s error messages for blocked content, and the user experience might get confusing for the user.
Instead, you should take the user to the login screen so he can provide his credentials and re-login accordingly.
You can call the nativeFunctions.logout() after you have confirmed that the user is not logged in: