I am using both Facebook PHP(4.0) and JS(2.0) SDK together. I can grab the user profile data with PHP but not the user's email. The user's email is available with the Javascript SDK, but I need it in PHP.
I was using:
$user_profile = (new FacebookRequest($session, 'GET', '/me'))->execute()->getGraphObject(GraphUser::className());
This works but the class GraphUser does not have a function to grab the user's email in 4.0.
Any ideas how I can grab user's email with Facebook PHP SDK version 4.0 ?
GraphUser
inherits from GraphObject
so you should be able to use the generic method to grab a field:
$user_profile->getProperty("email");
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句