I don't think you're calling the method properly.
Here's what the argument signature looks should look like
/**
* Publish a post to the user's stream.
*
* @param $message the user's message
* @param $attachment the post's attachment (optional)
* @param $action links the post's action links (optional)
* @param $target_id the user on whose wall the post will be posted
* (optional)
* @param $uid the actor (defaults to session user)
* @return string the post id
*/
public function stream_publish(
$message, $attachment = null, $action_links = null, $target_id = null,
$uid = null) {
But your code snippet shows $appid
where $uid
is expected.
Also, this wont work unless the user at $uid
has granted the proper permissions to your application.