5

I am a developer from the Republic of Korea.

I am currently making Facebook and Twitter-based websites.

I want to use a JavaScript API that can send message to friends,

So I consulted the iframe Javascript API methods or using Facebook page looked as sending.

I wonder,

I use to send messages to friends as a Javascript API that provides a?

I do not know English well. So I used Google translator.

Please understand.

(Edited, fixed some grammar and rewording)

FB.api (path, "post", {

        message: msg,

        caption: "caption caption",

        link: "http://www.naver.com",

        description: "Description Description",

        picture: "http://sstatic.naver.net/search/img3/h1_naver.gif",

        tag: "Tag",

        name: "name names",

        access_token: accessToken

        }, Function (response) {

        if (! response | | response.error){

            alert ("error");

        }

        else{

            alert (response.id);

        }

    })
Somnath Muluk
  • 55,015
  • 38
  • 216
  • 226
김동훈
  • 61
  • 2
  • 5

1 Answers1

3

You want to send a message to a friend on Facebook, or post to the Facebook wall for all to see? I am going to assume sending a message to a friend on Facebook.

Manual

If you want to send a message to friends on Facebook using the JS SDK, follow these instructions: https://developers.facebook.com/docs/reference/dialogs/send/

This isn't automatic and will still show a dialog box for the user to confirm.

Automatic

If you wanted to do it in the background via the Graph API, you can't. Here is a link explaining it in further detail why you can't and other options you have: https://stackoverflow.com/a/4061298/540339

Community
  • 1
  • 1
Adam
  • 16,089
  • 6
  • 66
  • 109
  • Answer Thank you. But https://developers.facebook.com/docs/reference/dialogs/send/ Approach using the iframe & facebook page sends a message. I want to spend on my page. – 김동훈 Apr 10 '12 at 07:22
  • If you want custom code and your own send dialog box then this isn't possible. If you wanted the send button you use this: https://developers.facebook.com/docs/reference/plugins/send/ – Adam Apr 10 '12 at 07:48
  • :) Thanks, Adam Resolve plug-in, but I want Sent directly to my page function. – 김동훈 Apr 10 '12 at 08:27