facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.95k forks source link

Deep pagination on instagram business discovery media edge does not work #1151

Open TomerKr opened 5 years ago

TomerKr commented 5 years ago

In version 5.7 of the SDK, API version 4.0 the media edge for the example on the request:

$url = "$pageNodeId?fields=business_discovery.username(nike){media}"

$media =$fb->sendRequest("GET", $url)->getGraphNode()->getField('business_discovery')->getField('media);

$media is a GraphEdge but calling $fb->next($media) returns null even though there is an "after" cursor. Manually building the request for the next page:

$after = $media->getNextCursor();
$url = "$pageNodeId?fields=business_discovery.username(nike){media.after($after)}"

Does return the next page however