Page 1 of 2 12 LastLast
Results 1 to 10 of 11

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

  1. #1
    Join Date
    Jun 2012
    Posts
    8

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Jun 2012
    Posts
    8

    Default

    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!

  4. #4
    Join Date
    Jun 2012
    Posts
    8

    Default

    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)

  5. #5
    Join Date
    Jun 2012
    Posts
    3

    Default

    seems problems have been solved

  6. #6
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  7. #7
    Join Date
    Jun 2012
    Posts
    8

    Default

    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.

  8. #8
    Join Date
    Jun 2012
    Posts
    8

    Default

    @tina09n "seems problems have been solved"

    How so?

  9. #9
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  10. #10
    Join Date
    Jun 2012
    Posts
    8

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •