Sunday, February 27, 2022

[FIXED] Getting error Argument 1 missing for FacebookRedirectLoginHelper

Issue

I am trying to the new Facebook api. I using the Facebook's own tutorial as my guide. The tutorial in the Facebook developer's site asks us that after we are redirected to from Facebook we should get a $helper. The code for that is given there. It is

$helper = new FacebookRedirectLoginHelper();

But I am getting an error. It says argument 1 missing for the __construct of FacebookRedirectLoginHelper(). What am I doing wrong? I need it to write my paper.


Solution

It's missing from the docs, but the first argument is the callback URL and it is required. Here's the source code.

$helper = new FacebookRedirectLoginHelper('https://example.com/facebook/callback');

Someone just submitted a PR to fix the docs.



Answered By - SammyK

No comments:

Post a Comment

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