'user_message' changed to 'message', however the 'message' string now no longer seems to populate the stream popup or post to the status/wall.

Is this another change from FB that's not reflected in their Docs, could they be disabling the feature -or- am I barking up the wrong tree? ;-)

Comments

Dave Cohen’s picture

Title: user_message and message stream publish no longer working? » user_message and message stream publish no longer working, update example code
Version: 6.x-3.0-rc8 » 6.x-3.x-dev
Category: support » task

Facebook used to let apps fill out that field. Now, apps must leave that blank, or rather it has no effect. Just one of the things they decided to change.

I'll leave this issue open because the code should be updated to reflect this. There's nothing we can do to make it work how it used to.

paulhudson’s picture

Darn,

I don't envy you Dave. FB's API is a complete mess made worse by their Docs.

Keep up the good work! :-)

jordijoan’s picture

Hi guys,

Do you mean that we can't populate the popup window message box?

fb_stream_publish_dialog(array('message' => $user_message,
                                     'attachment' => $attachment,
                                     'action_links' => $actions,
                               ));

Is this no longer working? In my site, the box's empty and I'm quite sure it was working fine until few days ago...

Thanks

paulhudson’s picture

I'm afraid so.

I've changed to using this to post directly to their wall along the lines of:

$stream = array('message' => $status_message,
												'name' => $title,
												//'caption' => '',
												'link' =>  url($tinyurl, array('absolute' => TRUE)),
												'description' => filter_xss('Check out the website', array()),
												//'picture' => 'logo_s.jpg',
												'actions' => array(array('name' =>  $user->profile_fullname,
												'link' => url($user->profile_website, array('absolute' => TRUE))))
												);
		
		social_post_fb_stream($stream);

You'll need the update_stream permission I think.

drubage’s picture

What is the social_post_fb_stream function it seems rad if I could find it, let me know!

paulhudson’s picture

Sorry, that was a bit of a useless example from me.

This worked for me...

function social_post_fb_stream($stream){
	global $user;
	
	if (!isset($fb_app)) {
		$fb_app = $GLOBALS['_fb_app'];
	}
	
	if (!$fb) {
    $fb = $GLOBALS['_fb'];
  }
	
	$fbu = fb_get_fbu($user->uid);
	
	$access_token = fb_get_token();
	
	$stream['access_token'] = $access_token;
	
	$result = $fb->api(
	  '/'.$fbu.'/feed/',
    'post',
   	$stream
	);
}


$stream = array('message' => $status_message,
                                                'name' => $title,
                                                //'caption' => '',
                                                'link' =>  url($tinyurl, array('absolute' => TRUE)),
                                                'description' => filter_xss('Check out the website', array()),
                                                //'picture' => 'logo_s.jpg',
                                                'actions' => array(array('name' =>  $user->profile_fullname,
                                                'link' => url($user->profile_website, array('absolute' => TRUE))))
                                                );
       
        social_post_fb_stream($stream);
kevinquillen’s picture

Thanks. The above tweak worked for me too. fb_get_user() stopped working for some reason.