开发者

Sending an App Generated Request with the JavaScript SDK

I am trying to send an app-generated request using the JavaScript SDK, following the PHP example here https://developers.facebook.com/blog/post/464.

I've tried this way:

FB.api( "/" + recipient + "/apprequests", "POST", {
    message: "Notification Message",
    data: "Notification data"
}, function( response ) {
    console.log( response );
} );

Where 'recipient' is the id of the user who should receive the request.

The above code worked only when sending request to the user that is currently logged in.

When sending a request to an开发者_如何转开发other user (who is connected to the app), the FB.api call returned the following error:

{
    "message": "(#2) User can't send this request: Unknown error",
    "type":"OAuthException"
}

Is it possible to send app-generated requests using the JavaScript SDK and if so, what is the correct way to do it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜