facebook realtitme update in android returns null

青春壹個敷衍的年華 提交于 2019-12-25 03:04:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!