问题
I would like to get realtime_update when user's friendlist changes and am trying to subscribe to friends
object .I have the code below where I added params.putString("access_token", "12|wewee");
because I used to get {This method must be called with an app access_token.}, isFromCache:false}
.Now I get the response as displayed below.I would like to get realtime subscription .How do I make it work? I really appreciate any help.Thanks in Advance.
code:
Bundle params = new Bundle();
params.putString("object", "user");
params.putString("access_token", "12|wewee");
params.putString("callback_url", "http://example.com/callback/update.php");
params.putString("fields", "friends");
params.putString("verify_token", "1234");
/* make the API call */
new Request(
session,
"/12345/subscriptions",
params,
HttpMethod.POST,
new Request.Callback() {
public void onCompleted(Response response) {
/* handle the result */
}
}
).executeAsync();
Note: session =fb.getsession();
added param to get app_access_tokem:
params.putString("access_token", "12|wewee");
and I get this response :
{Response: responseCode: 200, graphObject: GraphObject{graphObjectClass=GraphObject, state={"FACEBOOK_NON_JSON_RESULT":null}}, error: null, isFromCache:false}
来源:https://stackoverflow.com/questions/22957148/facebook-realtitme-update-in-android-returns-null