How to make Auto-Login for your Xamarin.Forms Mobile App.
The idea is to allow to the user to auto-login after his first verified connection.
(Here you find the simple project)
First of all you install this nuget package :
Install-Package AutoLogin.Mabrouk -Version 1.1.2
Now, let's code :)
In your App.xaml.cs (like here), class that represents the cross-platform mobile application, you write your test, if user's infos are already saved than you get directly the main page and the login page will be ignored :
Than, in your connection's button event, you save your users info (Email, Password) like :
Other thing, if you want to delete user's infos you, for exemple in DISCONNECT button, you add simply this line of code : CrossAutoLogin.Current.DeleteUserInfos(); like :
Source code is available on GitHub.
I hope this tutorial was helpful for you and that this will be nice part of your new App.
Best regards from Tegernheim ! :) Mabrouk Mahdhi