I have made a login with facebook button, when I click on that button it asks me for credentials and after successful login, it will alert my name and if I click it next time it will not ask me for credentials and only alert my name but this process only works on the android device. when I follow this process on IOS it asks me for credentials every time I click on the button.
Could you please clarify a little more. Are you looking to have the login persist each time you open the app? Or do you want to have to click the login button every time the app opens, but just not have to login to facebook through the pop up?
Thanks for reply, I want when a login button click for the first from new device it ask for the credentials and if same user click the login button again then it will only alert the name of the user i.e. it does not ask the user credentials again. I am having this issue in IOS only.
Basically I want it to keep me logged in
I believe that is more so the behavior of the operating system than expo. The only thing I’ve been able to do in the past is to save the auth token that facebook gives you and automatically sign back in using it.
So in your code, after you login, with facebook, you get a token back. I then use Expo’s SecureStore, to store that in the phone which persists between each time you open the app again. When the app first loads, I grab that token, make sure the token is still valid, and then I hit the facebook graph directly with that token to get the user info instead of having them log back in. I can try and put together an example if this isn’t clear enough to get you started.
It is working fine in android but in IOS it only keeps me logged in until I restart the app, Once I restart the app I have to give user credentials to it again.