이 내 코드입니다은 { "오류": { "메시지": "(# 100) 누락 메시지 나 첨부 파일", "유형": "OAuthException", "코드": 100}}
private void postToWall(String msg) {
Bundle parameters = new Bundle();
JSONObject attachment = new JSONObject();
String myjosn="{\"name\":\"LangGuage\",\"href\":\"http://www.hunkatech.com\",\"caption\":\" \",\"description\":\""+messageToPost+"\",\"media\":[{\"type\":\"image\",\"src\":\"http://hwsdemos.com/LangGuage/medal_1.png\",\"href\":\"http://www.hunkatech.com\"}],\"properties\":{\"Powered by:\":{\"text\":\"Hunka Technology Pvt. Ltd.\",\"href\":\"http://www.hunkatech.com\"}}}";
try {
parameters.putString(Facebook.TOKEN, facebook.getAccessToken());
parameters.putString("attachment",myjosn.toString());
String response = facebook.request("me/feed", parameters, "POST");
System.out.println("----responce" + response);
if (response.contains("Duplicate status message")) {
progressHandler.sendEmptyMessage(1);
resp = 1;
} else if (response == null || response.equals("")
|| response.equals("false") || response.contains("error")) {
Log.d("error", "error response");
} else {
progressHandler.sendEmptyMessage(0);
resp = 0;
}
} catch (Exception e) {
Log.e(TAG, "Posting fail");
e.printStackTrace();
}
}
Facebook의 wall에 이미지가있는 메시지를 게시하고 싶습니다. json json이 맞습니다. json formatter editor에서 확인했습니다. 다음 예외가 있습니다. 해결 방법을 제안해야합니다.
는 UPDATE : 내 메시지와 이미지 코드 아래의 도움으로 게시 : 나는 이미지를 갖고 싶어
parameters.putString("link", "http://www.hunkatech.com");
parameters.putString("picture", "http://hwsdemos.com/LangGuage/medal_1.png");
parameters.putString("name", "LangGuage");// name of link
parameters.putString("captions", "hello");
parameters.putString("message", "This is my message!!");
그러나 텍스트 왼쪽하지만 코드 위의 메시지 아래 Imgae로 결과를 제공합니다. 업데이트 : json.can 양식을 게시 할 수 없습니다. 누구든지이 문제를 해결하십시오. json으로 이미지와 마술을 묶는 첨부 파일을 보내려고합니다.
이 – Dinesh