2011-07-02 61 views
1

我正在開發一個Android應用程序,我必須邀請Facebook朋友使用Rest API的事件。Android的Facebook活動邀請

下面是其中I製備的參數

Bundle eventInviteParams = new Bundle(); 
    eventInviteParams.putString("method", "events.invite"); 
    eventInviteParams.putString("eid", event.getFacebookEventId()); 
    eventInviteParams.putString("personal_message", "Sample message"); 

    String userIds = ""; 
    for (int i = 0; i < facebookAdapter.getCount(); i++) { 
    FacebookUser user = facebookAdapter.getItem(i); 
    if (user.isSelected()) { 
     userIds += user.getId() + ","; 
    } 
    } 
    if (userIds.length() > 0) { 
    userIds = userIds.substring(0, userIds.length() - 1); // to remove last comma 
    eventInviteParams.putString("uids", userIds); 
    } 

束中的代碼然後

response = mFacebook.request(eventInviteParams); 

mFacebook其中實是API對象。

的響應總是

{ 「ERROR_CODE」:200, 「ERROR_MSG」: 「權限 誤差」, 「request_args」:[{ 「鍵」: 「的uid」, 「值」:」 XXXXXXXXX,XXXXXXXXX 「},{」 鍵 「:」 方法 「 」值「: 」events.invite「},{ 」鍵「: 」格式化「, 」值「: 」JSON「},{ 」鍵「:」 EID」, 「值」: 「XXXXXXXXXXX」},....]}

應用程序具有以下權限

"email","publish_stream","read_stream","create_event","offline_access","user_events","friends_events","rsvp_event" 

我還想提一提,我不是活動的創造者。我搜索了FCB文檔和谷歌,但無法找到正確的答案。

回答

1

非常感謝您的回覆。 我繼續研究,我發現錯誤

"error_code":200,"error_msg":"Permissions error" 

是因爲我不是以下事件。一旦我RSVP的事件,我得到了迴應false(我不知道爲什麼)和錯誤消失了。我在Facebook上查了一下,並邀請了特定的人。

感謝

0

只有創建該事件的用戶可以邀請其他人蔘加。即使用戶使用「嘉賓可以邀請朋友」創建活動,似乎也無法從應用中完成活動。幾個星期前,我嘗試了幾種方法無濟於事!