public function FacebookAuth::initSdk in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
- 8 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
- 8.2 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
- 8.3 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
- 8.4 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
- 8.5 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
- 8.6 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
- 8.8 modules/custom/social_auth_facebook/src/Plugin/Network/FacebookAuth.php \Drupal\social_auth_facebook\Plugin\Network\FacebookAuth::initSdk()
Returns an instance of sdk.
Return value
mixed Returns a new Facebook instance or FALSE if the config was incorrect.
Throws
\Drupal\social_api\SocialApiException
File
- modules/
custom/ social_auth_facebook/ src/ Plugin/ Network/ FacebookAuth.php, line 65
Class
- FacebookAuth
- Defines a Network Plugin for Social Auth Facebook.
Namespace
Drupal\social_auth_facebook\Plugin\NetworkCode
public function initSdk() {
$class_name = '\\Facebook\\Facebook';
if (!class_exists($class_name)) {
throw new SocialApiException(sprintf('The PHP SDK for Facebook could not be found. Class: %s.', $class_name));
}
if (!$this
->validateConfig($this->settings)) {
return FALSE;
}
$settings = [
'app_id' => $this->settings
->getAppId(),
'app_secret' => $this->settings
->getAppSecret(),
'default_graph_version' => 'v' . $this->settings
->getGraphVersion(),
'persistent_data_handler' => $this
->getDataHandler(),
];
return new $class_name($settings);
}