无法发布facebook Checkin状态Android

时间:2014-03-25 13:24:30

标签: android facebook facebook-graph-api facebook-android-sdk

错误:

  

响应= {"错误":{"消息":"(#100)需要扩展权限:publish_checkins或publish_actions","输入&# 34;:" OAuthException"," code":100}}

源代码:

Bundle params1 = new Bundle();
    params1.putString("access_token",token);
    params1.putString("place", "566414493392930");  // YOUR PLACE ID
    params1.putString("message","I m here in this place");
    JSONObject coordinates = new JSONObject();
    try {
        coordinates.put("latitude", "30.902823300000000000");
        coordinates.put("longitude", "75.830516900000020000");
    } catch (JSONException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }

    params1.putString("coordinates",coordinates.toString());
    params1.putString("tags",params[0]);//where xx indicates the User Id
    String response="";
    try {

    response =faceBook.request("me/checkins", params1, "POST");
        Log.v("Response","Response="+response);
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

1 个答案:

答案 0 :(得分:1)

嗯,错误表示需要权限:publish_checkinspublish_actions。要删除此错误,只需在验证用户身份时添加这些权限。了解它是如何完成的:Android login- permissions

但事实是,API 签入已被弃用Check here它说 -

  

Checkins已被弃用,支持将地点信息附加到帖子或标记Open Graph故事中的地点。请查看相关指南以获取相关信息。

所以你的代码无论如何都不行。您现在必须使用Open Graph Actions。在文档中有相同的步骤教程,只需通过它并实现。祝你好运。