简体   繁体   中英

Error sending message with FB API

I am doing something for a client and I wanted to test what I had so far by sending a message to the default test user. But it gave an error after I tried here it the function that isnt working...

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
    }
}

Error

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 is not a valid facebook id.

you should use a valid id. i'm not sure but you may able to use your own id too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM