我正在向 facebook 墙上发送消息,我的帖子包含图像和标题以及标题和描述。我想为我的单个帖子的不同项目提供不同的超链接。我成功地在 facebook 墙上发送帖子。但无法提供多个 url超链接。我的代码在这里
Bundle postParams = new Bundle();
postParams.putString(Facebook.TOKEN, facebook.getAccessToken());
postParams.putString("name", "LangGuage");
postParams.putString("href", "http://www.facebook.com");
postParams.putString("caption",msg);
postParams.putString("picture",url1);
postParams.putString("description","Powered by::Hunka Technology Pvt. Ltd.");
postParams.putString("link", "http://www.hunkatech.com");
我的图片、消息和标题都有相同的链接。如何为所有人提供不同的网址。
更新:我也尝试过这样做,但得到了这个:{“error”:{“message”:“(#100)缺少消息或附件”,“type”:“OAuthException”,“code”:100}}
JSONObject attachment = new JSONObject();
attachment.put(Facebook.TOKEN, facebook.getAccessToken());
attachment.put("message", "hi ");
attachment.put("name", "LangGuage");
attachment.put("link", "http://www.facebook.com");
attachment.put("caption", msg);
JSONObject media = new JSONObject();
media.put("type", "image");
media.put("picture", url1);
media.put("link","http://www.google.com");
attachment.put("media", new JSONArray().put(media));
JSONObject properties = new JSONObject();
JSONObject prop1 = new JSONObject();
prop1.put("text", "Powered by::Hunka Technology Pvt. Ltd.");
prop1.put("link", "http://www.hunkatech.com");
properties.put("Get the App for free", prop1);
attachment.put("properties", properties);
Log.d("FACEBOOK", attachment.toString());
Bundle params = new Bundle();
params.putString("attachment", attachment.toString());
String res = facebook.request("me/feed", params, "POST");
System.out.println("----resp" + res);
有没有可能从任何方式..