title: How to use facebook connect on mobile web application using the OAuth Dialog
body: <p>Now I'm developing a mobile web application using facebook connect, but I am having problems with the OAuth Dialog. I use the following facebook documents for my reference:</p>
  
  <p><a href="http://developers.facebook.com/docs/guides/mobile/#web" rel="nofollow">http://developers.facebook.com/docs/guides/mobile/#web</a></p>
  
  <p>I choose to use the OAuth Dialog instead of the Login Button because <strong>mobile browsers do not recognize the FBML</strong> (I use the Blackberry browser on testing). The OAuth Dialog also lets me add a list of permissions within the parameters of scope. But the problem is when I've logged in using the OAuth Dialog, <strong>the parameter $me wasn't recognized</strong> so that the login button still appears and doesn't not change to the logout button.
  Here is an example of my code:</p>
  
  <pre><code>$facebook = new Facebook(array(
    'appId'  =&gt; 'xxxxxxxxxxxxxxxx',
    'secret' =&gt; 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'cookie' =&gt; true,
  ));
  $session = $facebook-&gt;getSession();
  $me = null;
  // Session based API call.
  if ($session) {
    try {
      $uid = $facebook-&gt;getUser();
      $me = $facebook-&gt;api('/me');
      $accessToken = $facebook-&gt;getAccessToken();
    } catch (FacebookApiException $e) {
      error_log($e);
    }
  }
  if ($me) {
    echo "&lt;img src=\"images/logoutFB.gif\"&gt;";
  } else {
    echo "&lt;a href=\"http://www.facebook.com/dialog/oauth?scope=user_about_me,user_activities,user_birthday,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes&amp;client_id=".$facebook-&gt;getAppId()."&amp;redirect_uri=".urlencode("http://MYURL.COM")."&amp;display=wap\"&gt;&lt;img src=\"images/loginFB.gif\"&gt;&lt;/a&gt;";
  }
  </code></pre>
  
  <p>Is the parameter $me can't be used if I use the OAuth Dialog to connects to facebook? 
  So how do I know that I am already logged into facebook or not if I use the OAuth Dialog?
  Please help if you guys have the solution.</p>