Hey i'm trying to get public post from specific page but i don't want user to login.
and as stated in this Post that i can use my app access token for this
but my problem is how i can add my app token to graph request because AccessToken.getCurrentAccessToken()
return null and that obvious because the user is not authenticated
so what is the proper way to set the app access Token
this is my code
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/Page_id/posts",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
System.out.println(response.toString());
}
}
).executeAsync();