简体   繁体   中英

Android Facebook Connect

I wanna implement Facebook connect into my application on android. But i am not sure how the flow of the server side and the mobile interaction should it be.

  1. Login thru Facebook Facebook
  2. Receive and send Facebook User ID to the server
  3. Check if the user ID does not exist and create a new user details by fetching data from Facebook via graph API
  4. Once a data is fetched create a new user in the database and generate a mobile login session and send it to the phone
  5. store the session id and use that as reference as to the user has logged in

What i want in the application

  1. Once the user is logged in, until he logs out he should be logged in
  2. should i store the basic details of the user locally so that i don't need to fetch it each time ?
  3. what if i introduce my own login system among this how do i handle both ?

i understand its more of an implementation question and not programmatic

The Facebook login part looks ok to me.

Regarding the 1st feature you want in your application, you can store the user session may be in shared preferences file and check if every time while prompting for login screen. Erase the data after the user logs out. 2. You have the session ,which is indirectly referencing to user details, you don't need to fetch user details or store user details until you have the session. you can always get user details based on session id from the server. 3. You might have to keep track of the gateway the user is using to login ,like if it's a Facebook login session or your own login session.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM