我正在尝试在 facebook 上分享一些详细信息,它适用于某些用户但不适用于所有用户,它给出了所需发布权限的错误。
void shareEventDetailsOnFacebook() {
try {
if (Utilities.getDataFromPreferences(WhosGoingActivity.this, "SAHRE_ON_FACEBOOK", "ON").equals("ON")) {
Logger.logger(" FriendsDetailsActivity ", "response =======" + Session.getActiveSession().getPermissions().toString());
Bundle params = new Bundle();
params.putString("message", "I have booked!" + "\n\nEvent:" + Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_NAME", "-1") + "\nOn:" + Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_DATE", "-1") + "," + Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_TIME", "-1");
params.putString("name", Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_NAME", "-1"));
params.putString("picture", Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_IMAGE", "-1"));
params.putString("link", "www.google.com");
Logger.logger("message", "I have booked a night out!" + "\n\nEvent:" + Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_NAME", "-1") + "\nOn:" + Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_DATE", "-1") + "," + Utilities.getDataFromPreferences(WhosGoingActivity.this, "EVENT_TIME", "-1")+"#nightup");
facebookID = "";
for (int i = 0; i < listFaceBookID.size(); i++) {
facebookID = facebookID + listFaceBookID.get(i) + ",";
}
facebookID = removeCommaAtEndOfString(facebookID);
Logger.logger("FacebookIds ==================== " + facebookID);
params.putString("tags", facebookID);
params.putString("place", Utilities.getDataFromPreferences(WhosGoingActivity.this, "PAGE_ID", "-1"));
Logger.logger(" FriendsDetailsActivity permissions ", "response =======" + Session.getActiveSession().getPermissions().toString());
Request request = new Request(Session.getActiveSession(), "me/feed", params, HttpMethod.POST, new Request.Callback() {
@Override
public void onCompleted(Response response) {
Logger.logger(" invite() FriendsDetailsActivity invite() ", "response =======" + response.toString());
}
});
Request.executeBatchAsync(request);
}
} catch (Exception e) {
e.printStackTrace();
}
}
请帮帮我..