This is a discussion forum for the [size="4"]yii2-social extension[/size]. This is a module that enables access to social plugins for Yii Framework 2.0. It includes support for embedding plugins from the following networks into your website. View extension [size="4"]details and demos[/size].
Please Karthik I need your help i’m facing this error:
Argument 1 passed to Facebook\Helpers\FacebookRedirectLoginHelper::__construct() must be an instance of Facebook\Authentication\OAuth2Client, string given, called in /home/******/public_html/let/vendor/kartik-v/yii2-social/Module.php on line 207 and defined
This my view:
<?php/* @var $this yii\web\View */use kartik\social\Module;$this->title = 'Facebook';?><?php $social = Yii::$app->getModule('social');$url = Yii::$app->request->getAbsoluteUrl(); // or any absolute url you want to redirect $helper = $social->getFbLoginHelper($url);$loginUrl = $helper->getLoginUrl(); echo Html::a('Facebook Login', $loginUrl, ['class'=>'btn btn-primary']); ?>
Recently i have used the Yii2-social widget for the google signin, i have found that the google platform.js is included in the file GooglePlugin.php file. I have noticed that the js file is registered without the random string appended at the end. I suggest to append the random string in that js file.
If we didnt include the random string then the js file will not get loaded for the second time on the ajax request.
Scenario to use this random string purpose:
If we are going to have ajax popup login form with the google signin option then it will work only for the first time, for the next time without page load it wont work, it will not generate the google signin button. To Avoid that problem we need to include the random number after the js file name.