tags:

views:

251

answers:

3

Hi! I need to send messages on users wall or friends wall, I know how to post messages on my wall but how to post messages to another user wall??

thanks

A: 

to send to another user's wall - is absolutely the same as to send on current user's wall: with using Stream.publish

http://wiki.developers.facebook.com/index.php/Stream.publish

just specify target_id with needed user's id ;-)

zerkms
but how I can get the user's id without connect to his account??
Maki
huh? how do you determine "another user" from your question? do you know anything specific about that "another user"? the only possible way to post to non-current user's wall is: 1) to get active user to be ligged in (this user will be the author of post) 2) to know `user_id` of another user.
zerkms
I know user name and password of this "another user"
Maki
if you have no any active session or current user have no access to post to "another user"'s wall - you cannot post there. and password wouldn't help in any case.
zerkms
ok, but what is the key to post messages on this user wall?? how to obtain this permissions? To post message on my wall I don't need any extended permissions, maybe I need to add my FB application to user's page??
Maki
again: for posting to another user's wall you need: 1) active session 2) to know target user's id 3) access to posting to user's 2 wall by user 1.
zerkms
Can you post some code sample??
Maki
I add my application to users profile and it's working now, thanks a lot for your help
Maki
A: 

I trying to post the message using Stream.publish and nothing apear on user wall, I post my code here, what I'm doing wrong??

Facebook.Rest.attachment attachment1 = new Facebook.Rest.attachment();

                attachment1.caption="new attachment";
                attachment1.description="some description";

                List<action_link> col = new List<action_link>();
                action_link link = new action_link();
                link.href="http://www.genuineinteractive.com/";
                link.text="some text";

                facebookService1.Stream.Publish("new message", attachment1, col, "100001028091644", 0);
Maki
A: 

Try this... ñ_ñ

            try
        {
            String namePub = servicio.Users.GetInfo().first_name + "ha actualizado su estado";
            String cosa = servicio.Stream.Publish(richTextBox1.Text,
            new attachment()
            {
                name = namePub,
                href = "http://www.facebook.com/apps/application.php?id=136818146334647",
                caption = "Tú tambien puedes usar Escuchando ahora, es facil y rapido",
                properties = null,
                media = new List<attachment_media>()
                {
                    new attachment_media_image()
                    {
                        src="http://www.rammsdio.com.ar/images/img14781001.gif",
                        href = "http://www.facebook.com/apps/application.php?id=136818146334647"
                    }
                }
            },
            new List<action_link>() 
            {
                new action_link()
                {
                    text="Visita SQLeros",
                    href="http://www.sqleros.com.ar/wps"
                }
            }, stringId, 0);
            listBox1.Items.Add("Has actualizado tu estado...");
            richTextBox1.Clear();
            if (checkBox2.Checked)
                servicio.Stream.AddLike(cosa);
        }
        catch (FacebookException fb)
        {

            listBox1.Items.Add(fb.Message);
        }
rammsito