Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. use FacebookFacebookSession;
  2. use FacebookFacebookRedirectLoginHelper;
  3. use FacebookFacebookRequest;
  4. use FacebookFacebookResponse;
  5. use FacebookFacebookSDKException;
  6. use FacebookFacebookRequestException;
  7. use FacebookFacebookAuthorizationException;
  8. use FacebookGraphObject;
  9. use FacebookEntitiesAccessToken;
  10. use FacebookHttpClientsFacebookCurlHttpClient;
  11. use FacebookHttpClientsFacebookHttpable;
  12.  
  13. // start session
  14.  
  15. // init app with app id and secret
  16. FacebookSession::setDefaultApplication('1450546748547040','4c0b36c770bc22bdc45b40bd4c7b7229' );
  17.  
  18. // login helper with redirect_uri
  19.  
  20. $helper = new FacebookRedirectLoginHelper('http://www.immomix.ma/mysdk/src/begin.php' );
  21.  
  22. try {
  23. $session = $helper->getSessionFromRedirect();
  24. } catch( FacebookRequestException $ex ) {
  25. // When Facebook returns an error
  26. } catch( Exception $ex ) {
  27. // When validation fails or other local issues
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement