title: Publish Stream from the application - for non logged in user, using Graph API, php SDK
body: <p>Using graph api publish_stream permission: together with offline_access permission:</p>
  
  <p>As described <a href="http://facebookanswers.co.uk/?p=214" rel="nofollow">here</a> and <a href="http://facebook.stackoverflow.com/questions/4814432/publishing-to-users-wall-without-being-online-logged-in-facebook-sharing-usin">here</a>. However for some reason one of the following two things are happening:</p>
  
  <p>I am trying to post to a facebook user which is not currently logged in, following an action of a user which is curently logged in (e.g. telling user #1 that user #2 visited their farm in farmville, but user #1 is not logged in, while user #2 is. And they are not necessarily friends).</p>
  
  <p>When I tried this using the following code, the post was not created when users #1 and #2 were not friends (first problem), and when they were friends, the post was being created, but seemed like user #2 was posting it on user #1's wall (second problem - this is NOT what I am trying to do, I want it to be anonymous).
  See the first code I used:</p>
  
  <pre><code>    $post_id = $facebook-&gt;api('/' . $user1_id . '/feed/', 'post', array(
      'message' =&gt; 'Someone just visited your farm',
      'link' =&gt; 'http://example.com',
      'picture'  =&gt; 'http://example.com/img/picture.jpg',
      'caption' =&gt; 'Visit farms!'
      ));
  </code></pre>
  
  <p>So I tried to use the access token of user #1, which he gave me when he was logged in, and the application is supposed to be able to post on their wall even when they are offline (even without offline_access permission - see <a href="https://developers.facebook.com/docs/reference/api/permissions/" rel="nofollow">here</a> facebook's documentation: "you can publish... without requiring offline_access". At any rate, when I am adding the access_token to the array as a parameter (see the code below), no post is being created at all:</p>
  
  <pre><code>    $post_id = $facebook-&gt;api('/' . $user1_id . '/feed/', 'post', array(
              'access_token' =&gt; $user1_access_token,
      'message' =&gt; 'Someone just visited your farm',
      'link' =&gt; 'http://example.com',
      'picture'  =&gt; 'http://example.com/img/picture.jpg',
      'caption' =&gt; 'Visit farms!'
      ));
  </code></pre>
  
  <p>What should I do?</p>
  
  <p>gain, I am simply trying to publish to user's wall that is NOT logged in, but who gave me the publish_stream permission, a post from the application, not any other user, telling this user that someone (anonymously) has "visited their farm" (or created some action associated with them).</p>
  
  <p>Thanks everyone.</p>