问题
I'm trying to use GraphAPI for retrieving various posts using a search query/keyword from Facebook.
This is what I tried:
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/search?q=solareclipse&type=post",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
but I got this error:
{
"error": {
"message": "(#11) This method is deprecated",
"type": "OAuthException",
"code": 11,
"fbtrace_id": "AZD1YH0em2M"
}
}
Has Facebook completely taken back the privilege of searching through it's public posts or is there some other way available?
回答1:
Since Graph API v2.0 it is no longer possible to search through public posts.
There is a public feed API (https://developers.facebook.com/docs/public_feed), however the access is limited to certain media companies only.
来源:https://stackoverflow.com/questions/45828963/is-there-no-way-available-for-retrieving-posts-using-a-search-query-keyword-from