Facebook SDK,如何申请App Name

时间:2012-12-13 06:11:57

标签: android facebook

  

可能重复:
  Android: how to get the app name into our textview

嗨我试图从facebook获取appname但没有成功。如下所示

String queryApp = "SELECT  namespace  FROM application WHERE app_id=xxxxxxxxxxx";
                Bundle paramsApp = new Bundle();
                paramsApp.putString("method", "fql.query");
                paramsApp.putString("query", queryApp);
                String resultApp = Util.facebook.request(paramsApp);

                Log.e("APP RESULT", resultApp);

                JSONArray JAApp = new JSONArray(resultApp);

                for (int i = 0; i < JAApp.length(); i++) {
                    JSONObject JOApp = JAApp.getJSONObject(i);

                    String getDisplayName = JOApp.getString("display_name");
                    Log.e("DISPLAY NAME", getDisplayName);
                }

上面的代码无效。我可以使用facebookasyncrunner

来实现这个目标
Facebook facebook = new Facebook(YOUR_APP_ID);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);

// all your paramsApp bundle code
...

mAsyncRunner.request(paramsApp, new BaseRequestListener() {
   ...
});

但是bot确定如何使用它...任何建议都表示赞赏。

1 个答案:

答案 0 :(得分:0)

您只需要请求https://graph.facebook.com/ [APP_ID]

示例:

 https://graph.facebook.com/102452128776