facebook - allow lifetime checking of users inbox in our web app in fb php sdk -


i doing web app , should run in cron , checks if facebook user (who authorized app) has new unread message in inbox. updates in our database.

i using php script:

if ( isset( $session ) ) {   $request = new facebookrequest( $session, 'get', '/123456/inbox' );    $response = $request->execute();   $graphobject = $response->getgraphobject();      echo  print_r( $graphobject, 1 ); } else {   $params = array( 'read_mailbox' );   $weburl = "http://example.com/cron.php";   $helper = new facebookredirectloginhelper( $weburl );   $loginurl = $helper->getloginurl( $params );   header("location: $loginurl"); } 

it works when (user) visit page in browser not working in cron job.

how should write php instructions graph api able check of our users' inbox script? (without need of prior login via our page)


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -