2016-06-09 124 views
0

我正在爲客戶端做些事情,我想通過向默認測試用戶發送消息來測試我迄今爲止所做的。但它給了一個錯誤後,我想這是心不是工作的功能...用FB API發送消息時出錯

function sendWithoutTimerFunc() 
{ 
    try 
    { 
     FB.ui({ 
      app_id: '1226220854077249', 
      method: 'send', 
      link: 'https://developers.facebook.com/apps/1226220854077249/roles/test-users/', 
      to: '111526025937966', 
      message: 'Hello test user', 
      data: '...' 
     }); 
    } 
    catch(error) 
    { 
     alert(error); //Will change to console.log() later 
    } 
} 

錯誤

This dialog has been passed a bad parameter. 

API Error Code: 100 
API Error Description: Invalid parameter 
Error Message: Viewer cannot message specified recipients. 
+1

我從應用程序附帶的測試用戶那裏得到了該ID,感謝您讓我知道。我將我的個人資料添加爲測試用戶並使用該個人資料 – user6031759

回答

1

ID 111526025937966不是有效的Facebook的帳號。

您應該使用有效的ID。我不確定,但你也可以使用你自己的ID。

+0

添加了測試用戶,但我無法發送消息。 – user6031759

+0

@ user6031759和你得到的錯誤是什麼?確保你有授權你的app.you可以發送msg給只有已經授權你的應用程序的人 –

+1

我得到它的工作。我感謝你的幫助我的朋友。 – user6031759