Reputation: 1697
I'm very frustated, I can't figure out how to link accounts using the account_link button, it's making my life so hard, I posted this question before, and I thought I had understood how but I just didn't, it's driving me crazy.
Can someone please post a sample code of how to achieve this?
You get on you account linking url the GET parameters:
$token = $_GET['account_linking_token'];
$uri = $_GET['redirect_uri'];
Then you type in your credentials in the log in.
User: user
Password: pass
Click login.
You go and verify credentials, if they are correct, you link the account:
THIS IS THE SMALL BASIC EXAMPLE CODE I NEED
Then, if account linked succesfully, I redirect to the uri:
redirect($uri.'&authorization_code=myauthorizationtoken');
After this, I can retrieve PSID with the API.
Can somebody help me out please?
Upvotes: 3
Views: 2946
Reputation: 668
Your problem is that you do not understand what account linking really means. Account linking means that you should ask this current messenger user to login on your platform thereby linking the messenger account to the user account on your platform.
The flow is just an implementation of OAUTH 2.0. Please read it up to really understand what's going on. Your job is to just
Upvotes: 0
Reputation: 892
Check this out : Account Linking Failed
Use messaging_account_linking subscription for your Facebook developer application.
Upvotes: 2