发布照片给朋友的墙壁上与Android的Facebook [英] post a photo to friend's wall on facebook with android

查看:98
本文介绍了发布照片给朋友的墙壁上与Android的Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想发布的照片​​给我的朋友的墙上。我可以做得一样好,但有一个问题。任何人都无法看到它。我的意思是这张照片只显示好友的墙上..不是我或其他人没有朋友。我使用了一些权限,但也许我错过了什么。

I am trying to post photo to my friend's wall.. I can do it as well but there is a problem. Anyone cant see it. I mean this photo shows only friend's wall.. not mine or not others friend.. I used some permissions but maybe I missed something..

 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"};

和这里是我的codeS ..

and here is my codes..

            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();

 }

哪里是我的错?

Where is my mistake?

推荐答案

这似乎是你的第一个问题,我没有经过休息好了吗,我停在了这一点:

This seems to be your first problem, I haven't gone through the rest yet, I stopped at this:

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

除非我错了,你似乎有一些问题,你的报价。

Unless I'm mistaken, you seem to have some issues with your quotes.

这篇关于发布照片给朋友的墙壁上与Android的Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆