Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Facebook access_token
neo1986kk
post
Post #1





Grupa: Zarejestrowani
Postów: 561
Pomógł: 3
Dołączył: 2.02.2009

Ostrzeżenie: (0%)
-----


Witam mam taki problem, że kod raz działa, a raz nie działa, zależy jakie mam szczęście przy odświeżaniu

  1. $facebook = new Facebook(array(
  2. 'appId' => $app_id,
  3. 'secret' => $app_secret,
  4. 'cookie' => true,
  5. ));
  6.  
  7.  
  8. //Facebook Authentication part
  9.  
  10.  
  11. $userfb = $facebook->getUser();
  12.  
  13.  
  14. if($userfb){
  15. $access_token = $facebook->getAccessToken();
  16. $facebook->setAccessToken($access_token);
  17.  
  18. $parameters = array(
  19. 'message' => 'aaaaa',
  20. 'name' => 'aaaaa',
  21. 'caption' => 'aaaaa',
  22. 'description' => 'aaaaa',
  23. 'access_token'=>$access_token
  24. );
  25.  
  26.  
  27. //build and call our Graph API request
  28. $newpost = $facebook->api(
  29. '/me/feed',
  30. 'POST',
  31. $parameters
  32. );
  33. }
  34.  


Po odświeżeniu mam błąd: Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.

Może mi ktoś wytłumaczyć dlaczego raz access_token jest dobry a raz zły?

Ten post edytował neo1986kk 26.02.2013, 19:23:51
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 12:28