Announcement Announcement Module
Collapse
No announcement yet.
Is there a way to pass custom privacy settings when posting on User's friend's wall? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a way to pass custom privacy settings when posting on User's friend's wall?

    Basically, what I'm trying to accomplish is to have the application post a message on the logged in User's FRIEND'S wall so this message is only visible to the User and the Owner of the wall the message is being posted on. It seems you can do something like that in php:

    $privacy = array(
    'value' => 'CUSTOM',
    'friends' => 'SOME_FRIENDS',
    'allow' => 'XXXXXXX,YYYYYYY' // Change this to your friends ids
    );
    $params = array();
    $params['privacy'] = json_encode($privacy);
    $params['message'] = "Special for TWO friends";
    $post_id = $facebook->api('/me/feed', 'POST', $params);
    var_dump($post_id);

    Thank you so much for your help!!!
    Dima

  • #2
    Spring Social's Facebook API binding does not currently support setting privacy on a post. But that sounds like a good thing and it should support it. Could I ask you to open an improvement issue at https://jira.springsource.org/browse/SOCIALFB and I'll add it to the roadmap.

    Comment


    • #3
      I see, ok, I will open an improvement issue. What about sending private messages on behalf of the user to his/her friends? Is this supported? Thanks a lot!

      Comment


      • #4
        I actually modified the Spring Social source to set the privacy parameter. However, running it I got exception signaling that FB does not allow you to set privacy parameter when executing targeted wall posts. Please see below.

        @habuma - Could you please reply to my previous question? Can we send private messages on behalf of the user to his/her friends via SS API?


        2012-06-11 11:22:22,075 [http-bio-8080-exec-5] ERROR service - (#100) The privacy param cannot be applied when a target is specified.
        sys.outorg.springframework.social.UncategorizedApi Exception: (#100) The privacy param cannot be applied when a target is specified.
        at org.springframework.social.facebook.api.impl.Faceb ookErrorHandler.handleUncategorizedError(FacebookE rrorHandler.java:158)
        at org.springframework.social.facebook.api.impl.Faceb ookErrorHandler.handleError(FacebookErrorHandler.j ava:63)
        at org.springframework.web.client.RestTemplate.handle ResponseError(RestTemplate.java:486)
        at org.springframework.web.client.RestTemplate.doExec ute(RestTemplate.java:443)
        at org.springframework.web.client.RestTemplate.execut e(RestTemplate.java:415)
        at org.springframework.web.client.RestTemplate.postFo rObject(RestTemplate.java:294)
        at org.springframework.social.facebook.api.impl.Faceb ookTemplate.publish(FacebookTemplate.java:198)

        Comment


        • #5
          seems problems have been solved

          Comment


          • #6
            Sorry that I didn't respond to your question quickly enough (I had taken a few days of vacation and wasn't online much in the past few days).

            When you ask if you can send private messages, I'm sorry to say that you can't do that yet either. Facebook's API was in a state of change regarding that functionality at the time when Spring Social 1.0.0 was released and so I purposefully left it out until the API had stabilized. Now that it has stabilized, I have it planned for v1.1.0, but have not yet started work on it. I know that's not the answer you're looking for, but...I will try to carve out some time today or tomorrow to give it another look and see if I can implement it. I'll let you know.

            Comment


            • #7
              Thank you!
              I was doing an investigation myself and it seems that Facebook API is very tricky when it comes to private messages. I may be missing something, but I couldn't find the FB api for sending a private message. What I found is a javascript FB send dialog which can be integrated into a page. However, this dialog prevents you from sending a private message to more than one friend at a time - something that's critical for me. Amazingly, it seems that FB has whitelisted some of the apps (i.e. by Ebay, Pinterest) to provide them but not others with that feature.

              Please keep me posted about your findings,
              Thank you so much,
              D.

              Comment


              • #8
                @tina09n "seems problems have been solved"

                How so?

                Comment


                • #9
                  As I reviewed my notes on this, I remembered that an app *can't* send private messages via the API. I believe the reasoning is to avoid having applications send spam to other users on behalf of the user who authorized the application (just speculation...I don't know the real reason for sure).

                  What I had in mind for 1.1.0 is the ability to read a user's mailbox, but not send messages. See https://jira.springsource.org/browse/SOCIALFB-85.

                  But I still plan to look into setting privacy when posting. For that, I see that you created https://jira.springsource.org/browse/SOCIALFB-88.

                  Comment


                  • #10
                    Thanks Craig.

                    When trying to set privacy while doing targeted wall posts I got this error (presumably from FB) :

                    ERROR service - (#100) The privacy param cannot be applied when a target is specified.

                    Please keep me posted about your findings.

                    Dmitriy

                    Comment


                    • #11
                      Yeah, that's definitely a Facebook error. The "(#100)" part of it is a clue, as many FB errors have an error code embedded in the text like that.

                      Sounds like this might not be do-able because of some Facebook limitations. But I'm still poking at it to see what will work.

                      Comment

                      Working...
                      X