title: How to post a feed item in friend's wall via Graph API
body: <p>I am making a very simple gift application on Facebook. The main problem here is how to notify the user which don't use the application about the fact that his friend send him a gift?</p>
  
  <p>As the Notifications are disabled on old REST API and <code>stream.publish</code> will not work on the friends who didn't authorize to post on their wall, I am confused. </p>
  
  <pre><code>if (!empty($_REQUEST["ids"]) ) {
      $friends = ( isset($_REQUEST["ids"]) ) ? $_REQUEST["ids"] : 0;
  
      if (empty($_POST['giftname']) ) {
          $gname = '1.gif';
      } else {
          $gname = $this-&gt;input-&gt;post('giftname');
      }
      //$this-&gt;app_model-&gt;send_gift( $user, $friends, $gname,$facebook );
      //$this-&gt;app_model-&gt;send_gift( $user, $friends, $gname,$facebook );
      $to=$friends;
      $from=$user;
      $gift=$gname;
  
      $total_send=count($friends);
  
      for ($x=0; $x&lt;$total_send; $x++ ) {
  
          $this-&gt;db-&gt;query("INSERT INTO gifts (`giftfrom`, `giftto`, `gname`) VALUES( $from, $to[$x], \"$gift\" )");
  
          try {
              // Send notification
              //$facebook-&gt;api_client-&gt;notifications_send($to[$x], 'sent you a gift using &lt;a href="http://apps.facebook.com/tsaxikner/"&gt;Հայկական Նվերներ&lt;/a&gt;. &lt;a href="http://apps.facebook.com/tsaxikner/"&gt;Ստանալ Նվերը&lt;/a&gt;.');
  
              // Publish feed story
              $feed_body = '&lt;fb:userlink uid="'.$from.'" shownetwork="false"/&gt;-ը նվեր է ուղարկել &lt;fb:name uid="'.$to[$x].'"/&gt;-ին  &lt;a href="http://apps.facebook.com/tsaxikner/"&gt;Հայկական Նվերներ&lt;/a&gt;-ի միջոցով.';
  
              $feed_body = 'Ստուգեք &lt;a href="http://apps.facebook.com/tsaxikner/"&gt; &lt;fb:name uid="'.$to[$x].'" firstnameonly="true" possessive="true"/&gt; Հայկական Նվերներ&lt;/a&gt;.';
  
              //$facebook-&gt;api_client-&gt;feed_publishActionOfUser($feed_title, $feed_body);
              $facebook-&gt;api_client-&gt;make_wall_post($user,$to[$x],$feed_body);
              $facebook-&gt;api_client-&gt;notifications_sendEmail($user, 'You have a gift', $feed_body, $fbml);
  
              //$facebook_graph-&gt;api('' $message, null, null, $target_id );
          }
          catch(Exception $e) {
              echo $e-&gt;getMessage();
          }
      }
      // end of for
  }
  </code></pre>
  
  <p>I use FBML</p>