PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, March 6, 2022

[FIXED] Android app custom user registration and login with cookie using facebook sdk

 March 06, 2022     android, cookies, facebook-android-sdk, facebook-php-sdk, php     No comments   

Issue

I am developing an android application in which users need to register and log in using Facebook.

Approximately, this would be the flow.

Open the app for the first time, authenticate with Facebook, get their data, send the data to my server to create them an account in my application, start session with their new account in my server, get a cookie to perform later interactions.

So far so good.

What I need to know is wich data i have to send to my server, so i can be able to identify the users when they log in for the seccond time. This is because i need to start session in my server and send a cookie to the android app to do the further interactions. I'm using PHP as server side language.

I was thinking about getting the getAccessToken() in the android facebook sdk, then pass it to my server on the account creation and storing it in my android app.

But i can't manage how to do it to login the users on the second time they use the app.

Any suggestions ? Thanks in advance !


Solution

To uniquely identify the user within your app, you should make a request to /me and get the user's id. This is guaranteed to be unique and remain constant for your user/app combination.

The access token is not guaranteed to remain constant.



Answered By - Ming Li
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing