0
votes

How can I get user access token though server-side authentication Facebook sdk. I have faced this error:

Catchable fatal error: Argument 1 passed to Facebook\Helpers\FacebookRedirectLoginHelper::__construct() must be an instance of Facebook\Authentication\OAuth2Client, string given, called in /home/ds09/public_html/adopted/newsiteadmin/facebook_sdk_api/examples/access_token.php on line 50 and defined in /home/ds09/public_html/adopted/newsiteadmin/facebook_sdk_api/src/Facebook/Helpers/FacebookRedirectLoginHelper.php on line 75

Thanks for help in advance

2
Thanks for help, but this page provide the solutions using login pop up box, but i need to get the user access token through coding. this is used in scheduler, please help. - Rahul Mangal
You can't. It is not possible - WizKid

2 Answers

1
votes

Facebook does not provide the user access token without any user intervention, My requirement is to get the access token through programming which i use in scheduler.

But i get the task done through a different way, In this way you do not need to get the user access token every-time when you do some API operation, You can get it one time manually from Facebook and use this forever.

This is the link where you can get the user access token for your app and you can verify it on this link.

Thanks.

0
votes

Check this page, it help me a lot.

Begin first checking the Requirements:

  1. Check the hosting PHP version 5.4 or higher
  2. Check mbstring enabled and the values

https://benmarshall.me/facebook-php-sdk/#requirements