Query Master
Query Master

Reputation: 7097

Facebook Offline AccessToken Issue in CronJob

I have an issue of Facebook offline access-token please help me out how to solve this issue helps are definitely appreciated

That my code when i was tried

$access_token="AAACEdEose0cBAK2USdNINUVUuCNip2zlPyMoL19in3LzeZAP9ydifNV7oeBC2T4zdCZCUvhDW3FDxOcHzA6ofDHQX24Tbw1VwLGdzT0AZDZD";

$facebook_url="https://graph.facebook.com/".$dataPageId->PageID."/feed?access_token=".$access_token;
$facebookPageStatus=file_get_contents($facebook_url);
$fpsjson=json_decode($facebookPageStatus);

One more thing there is no Facebook session file in my code basically i want this functionality for cronjob... OR if i execute my code they generate an error like this

enter image description here

Upvotes: 0

Views: 306

Answers (1)

Nitzan Tomer
Nitzan Tomer

Reputation: 164137

I've seen a lot of questions here about facebook api requests failing because of the use of file_get_contents. Check out these threads: Unable to file_get_contents to work, File_get_contents not working?, or just search for more threads: "[facebook] file_get_contents".

Other than that, I recommend you to stop using the offline_access since it is deprecated: Deprecation of Offline Access Permission

Upvotes: 1

Related Questions