使用 Android 将照片发布到 Facebook 上朋友的墙上

2024-04-19

我正在尝试将照片发布到我朋友的墙上。我也可以这样做,但有一个问题。任何人都看不到。我的意思是这张照片只显示了朋友的墙。不是我的,也不是其他朋友的。我使用了一些权限,但也许我错过了一些东西。

 private static final String[] PERMS = new String[] {"manage_pages", "read_insights", "user_checkins", "user_birthday","friends_birthday","email","user_photos","publish_checkins","publish_actions", "read_stream" ,"publish_stream","read_friendlists"};

这是我的代码..

            public void postPhoto() {

            String accessToken = mFacebook.getAccessToken();
            params.putString("message", message); 
            params.putString("target_id", friendID); 
            params.putString(Facebook.TOKEN, accessToken);      
            response= mFacebook.request(friendID" + "/photos", params, "POST");
            response = "{\"data\": [" + response + "] }";
            String photoID = GetIDPhoto(response);

            setTag(photoID, friendID);  
          }

private void setTag(String photoID,String friendID) {

    String relativePath = photoID + "/tags/" + friendID;
    Bundle params = new Bundle();
    params.putString("x", "30");
    params.putString("y", "30");
    String response ="";

    try {
        response = mFacebook.request(relativePath, params, "POST");
    } 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();
    }
    Toast.makeText(getApplicationContext(), response, 3000).show();

 }

我的错误在哪里?


这似乎是你的第一个问题,我还没有完成其余的问题,我停在了这里:

response= mFacebook.request(friendID" + "/photos", params, "POST");
        response = "{\"data\": [" + response + "] }";

除非我弄错了,否则你的引用似乎有一些问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 Android 将照片发布到 Facebook 上朋友的墙上 的相关文章

随机推荐