How to Logout From Facebook


#1

i used ```
Expo.Facebook.logInWithReadPermissionsAsync

I didin't find a function to logout.

#2

Hey @chiteni,

The logInWithReadPermissionsAsync method is just used to provide a facebook token that gives you access to information via the Facebook API. You handle the log out logic on your own with whatever auth system you have in place.

Cheers,

Adam


#3

Dear @adamjnav,
thank you for your reply.
i am new with react native, and i am using Expo because it helps me a lot.
I followed the instructions to Login using facebook and google.
I don’t know how to log out using any Auth system. can you please provide me with one. Please take not that i don’t want to Eject from Expo.


#4

Dear @adamjnav
i found a solution, in order not to detach from Expo.
In order to logout from Expo.Facebook.logInWithReadPermissionsAsync
send a fetch with delete tp graphApi
var lParams= access_token=${token};
fetch(
https://graph.facebook.com/User_id/permissions’,{
method : ‘DELETE’,
body: lParams
}

instead of User_id put the one that it comes from facebook you can get it
const response = await fetch(
https://graph.facebook.com/me?fields=id,name,first_name,last_name,middle_name,picture,email&access_token=${token});
console.log("response " );

It took from me too much time. But at the end i did it.
Thank you again


closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.