title: "via my application" isn't shown on most cell phones when my app posts to facebook
body: <p>We have an app on Facebook. It posts quotes hourly on behalf of users even when they are offline. But when php script runs to post to users timeline i am actually facing 2 serious problems.<br><br>Firstly and the most urgent is "via app name" is not shown under the username when you read news feed from new touch cell phones like BlackBerry, Samsung &amp; iphone. This point is very critical since the app users don't like to post something on their behalf directly without "via app name".<br><br>Secondly the script is taking almost 40 secs to be excuted, however i have only 15 users till now. Please help. Here is my PHP Code: </p>
  
  <pre><code>&lt;?PHP
  require_once '../inc/config.php';
  
  $dbh = new PDO('mysql:dbname=' . $db_name . ';host=' . $db_host . ';charset=utf8', $db_username, $db_password);
  
  $dbh-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);
  $dbh-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
  $sqlid  = "SELECT fb_id FROM offline_access_users";
  $sqlmsg = "SELECT msg_id,message FROM fb_messages WHERE msg_id = (SELECT MAX(msg_id) FROM fb_messages WHERE sent = 'No' ORDER BY msg_id)";
  
  try {
      $stmt = $dbh-&gt;prepare($sqlid);
  
      $stmt-&gt;execute();
  
      $msg = $dbh-&gt;prepare($sqlmsg);
  
      $msg-&gt;execute();
  
      $msg_to = $msg-&gt;fetch();
  
      $msg_tosend = $msg_to['message'];
  
      $msg_tosendid = $msg_to['msg_id'];
  }
  catch (PDOException $e) {
      echo $e-&gt;getMessage();
      die();
  }
  
  while ($value = $stmt-&gt;fetch()) {
      $id  = $value['fb_id'];
      $url = "https://graph.facebook.com/" . $id . "/feed";
  
      $ch = curl_init();
  
      $attachment = array(
  
          'access_token' =&gt; $access_token,
          'message' =&gt; $msg_tosend,
          'app_id' =&gt; $fb_app_id,
          'from' =&gt; $fb_app_id,
          'display' =&gt; "touch",
          'to' =&gt; "",
          'redirect_uri' =&gt; "http://mydomain.com",
          'link' =&gt; "",
          'picture' =&gt; "",
          'source' =&gt; "",
          'caption' =&gt; "",
          'description' =&gt; "",
          'actions' =&gt; ""
      );
  
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
      curl_setopt($ch, CURLOPT_POST, TRUE);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
  
      $result = curl_exec($ch);
  }
  
  curl_close($ch);
  
  $sqlupdate = "UPDATE fb_messages SET sent = 'Yes' WHERE msg_id=" . $msg_tosendid;
  
  try {
      $stmt = $dbh-&gt;prepare($sqlupdate);
  
      $stmt-&gt;execute();
  }
  catch (PDOException $e) {
      echo $e-&gt;getMessage();
      die();
  }
  
  $db = null;
  
  ?&gt;
  </code></pre>