Facebook php sdk v4 get unlimited messages from user inbox -
i'm trying user messages of threads, can 30 last messages of each thread:
$request = new facebookrequest($session, 'get', '/me/inbox?comments_limit=9999'); $response = $request->execute(); $threads = $response->getgraphobject()->asarray(); $comments = $threads->comments; foreach($comments $messages) { foreach($messages $message) { echo $message->from->name.'<br />'; echo $message->message.'<br /><br />'; } }
do know how can unlimited messages?
thanks
you need implement paging entries: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#paging
for example, use recursive function that. keep in mind may run api call limits if there lot of messages.
you can increase limit bit, maximum 100: /me/inbox?limit=100
Comments
Post a Comment