chciałem zrobić prostą aplikacje na facebooku, i mam pewien problem a FB docs, jest dla mnei trochę niejasne w tym zagadnieniu.
Do rzeczy, jak rozwiązać sprawę gdy Access Token wygasa, gdy user coś wtedy kliknie dostanie błąd brak dostepu/autoryzacji itp ?
Access token, tworzy się gdy loguje się user (w tym dostaje różne prawa do czytania różnych danych, tak ?

bardzo dziękuje
przepraszam za odgrzanie tematu, ale mam nowe infromacje, które mogą trochę pomóc
https://developers.facebook.com/blog/post/2...-access-tokens/
według ich bloga (niby dokumentacji...)
<?php $app_id = "YOUR_APP_ID"; $app_secret = "YOUR_APP_SECRET"; $my_url = "YOUR_POST_LOGIN_URL"; // known valid access token stored in a database $access_token = "YOUR_STORED_ACCESS_TOKEN"; $code = $_REQUEST["code"]; // If we get a code, it means that we have re-authed the user //and can get a valid access_token. $token_url="https://graph.facebook.com/oauth/access_token?client_id=" . "&client_secret=" . $app_secret . "&code=" . $code . "&display=popup"; $params = null; $access_token = $params['access_token']; } // Attempt to query the graph: $graph_url = "https://graph.facebook.com/me?" . "access_token=" . $access_token; $response = curl_get_file_contents($graph_url); $decoded_response = json_decode($response); //Check for errors if ($decoded_response->error) { // check to see if this is an oAuth error: if ($decoded_response->error->type== "OAuthException") { // Retrieving a valid access token. $dialog_url= "https://www.facebook.com/dialog/oauth?" . "client_id=" . $app_id . "'</script>"); } else { } } else { // success } // note this wrapper function exists in order to circumvent PHP’s //strict obeying of HTTP error codes. In this case, Facebook //returns error code 400 which PHP obeys and wipes out //the response. function curl_get_file_contents($URL) { $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $URL); $contents = curl_exec($c); $err = curl_getinfo($c,CURLINFO_HTTP_CODE); curl_close($c); if ($contents) return $contents; else return FALSE; } ?>
taki kod ma się wszystkim zająć,
Czyli to jest tak ?
- Muszę mieć ostatni access_token w swojej bazie
- Jeżeli jest zmienna $_REQUEST["code"] to znaczy, że user coś zmienił i muszę pozyskać nowy access token
- reszta kodu odpowiedzialna za łapanie błędów, tak ?