Comments (6)
I am facing same issue Kartik please can you help on this.
from yii2-social.
You have not mentioned where and how you received the error.
The error mentions that you failed to pass a facebook session identifier.
If you are using facebook api, check the documentation on how to use the facebook api
from yii2-social.
Sorry I know question is closed but when I use this code.
$social = Yii::$app->getModule('social');
// Render the Login button
$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']);
// in your other action that processes the login
// use the output from the helper
$helper = $social->getFbLoginHelper($url); // the same url
$session = $social->getFbSession(['source'=>$helper]); // do anything with this session now
// for example get the graph user object for current user
$user = $social->getFbGraphUser($session);
echo 'User is ' . $user->getName();
the error goes when I comment out the last two lines
//$user = $social->getFbGraphUser($session);
//echo 'User is ' . $user->getName();
and button appears. If these lines are removed than how a session is created. thanks in advance.
from yii2-social.
An example set of codes are provided. But you need to use them carefully. NOTE: not all code in the example is to be written altogether in the same view.
You need to read through the comments.
The button is created via Html::a
Subequently you need to write the rest of the code in the loginUrl
controller action as mentioned in the comment
// in your other action that processes the login
// use the output from the helper
from yii2-social.
Thanks Karthik that was very helping.
from yii2-social.
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/itenginn/public_html/let/vendor/kartik-v/yii2-social/Module.php on line 207 and defined
This my view:
title = 'Facebook'; ?>tools/facebook
Please login to facebook to start using this tool: 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']); ?>
</br>
</div>
from yii2-social.
Related Issues (20)
- To Get & Save Google+ Signin Profile Data in Database HOT 1
- [Bug] Underfined variable exception HOT 1
- Twitter size issue HOT 2
- VKPlugin error. HOT 1
- Web App don't use mobile native app to login
- Sessions are not active when updated facebook SDK to 5.1.4 HOT 1
- Facebook Language, replace hyphen
- Unable to locate message source for category 'kvsocial'. HOT 3
- Package facebook/php-sdk-v4 is abandoned HOT 2
- Error Setting unknown property: kartik\social\Module::google-analytics HOT 1
- Enhancements for new Facebook Graph SDK
- New `FacebookPlugin::SAVE` button
- Facebook API version is out of date HOT 1
- can i change the facebook icon for like and sharing HOT 2
- How to post a new post on facebook wall? HOT 1
- Update disqus plugin initialization HOT 1
- Deprecated jQuery method usage in VK plugin HOT 2
- Social updates
- Support for Apple ID - Login HOT 1
- Docs say google-analytics when it should be googleAnalytics HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-social.