使用 FB API 发送消息时出错

Error sending message with 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.

id 111526025937966 不是有效的 facebook id。

您应该使用有效的 ID。我不确定,但您也可以使用自己的 ID。