title: FB.API Facebook Open Graph returns empty data for user likes for some users
body: <p>I have a page in which when the app is permitted by a user, it will list down the user's page likes, and checks whether the user liked my certain facebook page and is a member of that facebook page (in a way both are similar), using FB.API</p>
  
  <p>The problem is that certain users are not returning any data at all, regardless of OS or browser. I already set the 'user_likes' permission on the app, but to no avail.</p>
  
  <pre><code>    &lt;html&gt; 
  &lt;head&gt; 
  &lt;title&gt;My Facebook Login Page&lt;/title&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
      &lt;div id="fb-root"&gt;&lt;/div&gt; 
      &lt;div id="lblName"&gt;&lt;/div&gt; 
      &lt;div id="lblAccessToken" style="display: none;"&gt;&lt;/div&gt; 
      &lt;br&gt;&lt;br&gt; 
      &lt;fieldset&gt; 
          &lt;legend&gt;Your Page Likes&lt;/legend&gt; 
          &lt;div id="lblLikes"&gt;&lt;/div&gt; 
      &lt;/fieldset&gt; 
  
      &lt;fieldset&gt; 
          &lt;legend&gt;Check whether you like [My Fan Page] &lt;/legend&gt; 
          &lt;div id="lblYouLike"&gt;&lt;/div&gt; 
      &lt;/fieldset&gt; 
  
      &lt;fieldset&gt; 
          &lt;legend&gt;Check whether you are a fan of [My Fan Page]&lt;/legend&gt; 
          &lt;div id="lblMem"&gt;&lt;/div&gt; 
      &lt;/fieldset&gt; 
      &lt;div id="divLogin" style="display:none;"&gt; 
      &lt;div class="fb-login-button"&gt;Login with [App]&lt;/div&gt; 
  &lt;/div&gt; 
  &lt;script&gt; 
      var accessToken; 
      var uid; 
      var lblName = document.getElementById("lblName") 
      var divLogin = document.getElementById("divLogin") 
      var lblAccessToken = document.getElementById("lblAccessToken") 
      var lblLikes = document.getElementById("lblLikes") 
      var lblYouLike = document.getElementById("lblYouLike") 
      var lblMem = document.getElementById("lblMem") 
  
      window.fbAsyncInit = function () { 
          FB.init({ 
              appId: 'APP_ID', // App ID 
              channelUrl : 'http://www.example.com/testing/channel.html', // Channel File 
              status: true, // check login status 
              cookie: true, // enable cookies to allow the server to access the session 
              xfbml: true // parse XFBML 
          }); 
  
          FB.getLoginStatus( 
              function (response) { 
                  checkStatus(response) 
              } 
          ); 
  
          FB.Event.subscribe( 
              'auth.authResponseChange', 
              function (response) { 
                  checkStatus(response) 
              } 
          ); 
  
          FB.Event.subscribe( 
              'edge.create', 
              function (response) { 
                  //alert('You liked the URL: ' + response); 
                  ufCheckLike() 
              } 
          ); 
      }; 
  
      // Load the SDK Asynchronously 
      ( 
          function(d){ 
              var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; 
              if (d.getElementById(id)) {return;} 
              js = d.createElement('script'); 
              js.id = id; 
              js.async = true; 
              js.src = "//connect.facebook.net/en_US/all.js"; 
              ref.parentNode.insertBefore(js, ref); 
          } (document) 
      ); 
  
      function checkStatus(response){ 
          if (response.status === 'connected') { 
              uid = response.authResponse.userID; 
              accessToken = response.authResponse.accessToken; 
  
              lblAccessToken.innerHTML = accessToken; 
  
              FB.api( 
                  '/me', 
                  'get', 
                  function(response) { 
                      lblName.innerHTML = response.name; 
                  } 
              ); 
  
              divLogin.style.display = "none"; 
  
              ufCheckLike() 
          } 
          else { 
              divLogin.style.display = ""; 
          } 
      } 
  
      function ufCheckLike() { 
          if (isLoggedIn()) { 
              FB.api( 
                  '/me/likes?' + 
                  'access_token=' + accessToken, 
                  'get', 
                      function(likes) { 
                          if (likes) { 
                              if (likes.data &amp;&amp; likes.data.length &gt; 0) { 
  
                                  for (var i = 0; i &lt; likes.data.length; i++) { 
                                      var like_detail = likes.data[i] 
                                      var lsHTML = like_detail.name + " : " + like_detail.id + "&lt;br&gt;" 
                                      if(like_detail.id == "&lt;PAGE_ID&gt;") 
                                          lblLikes.innerHTML = lsHTML + lblLikes.innerHTML 
                                      else 
                                          lblLikes.innerHTML += lsHTML 
                                  } 
  
                              } 
                          } 
                      } 
              ); 
  
              FB.api( 
                  '/me/likes/&lt;PAGE_ID&gt;?' + 
                  'access_token=' + accessToken, 
                  'get', 
                  function(likes) { 
                      if (likes) { 
                          if (likes.data &amp;&amp; likes.data.length &gt; 0) { 
                              lblYouLike.innerHTML = "You Like [Fan Page]!" 
                          } 
                      } 
                  } 
              ); 
  
              FB.api( 
                  '/&lt;PAGE_ID&gt;/members/' + uid + '?' + 
                  'access_token=' + accessToken, 
                  'get', 
                  function(likes) { 
                      if (likes) { 
                          if (likes.data &amp;&amp; likes.data.length &gt; 0) { 
                              lblMem.innerHTML = "You are a fan of [Fan Page]!" 
                          } 
                      } 
                  } 
              ); 
  
          } 
  
      } 
  
      function isLoggedIn() { 
          if (!accessToken) { 
              divLogin.style.display = ""; 
              return false; 
          } 
          return true; 
      } 
  &lt;/script&gt; 
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>I also implemented an FQL which practically does the same thing to check whether a user has liked my page and the same scenario is happening on certain users where data object returns empty rows.</p>
  
  <pre><code>var query = "SELECT uid FROM page_fan  where uid=me() and page_id = PAGE_ID ' + 'and access_token = " + accessToken;
  //Access token is optional
  var names = FB.Data.query(query);
  names.wait(
      function (rows) {
          if (rows.length &gt; 0) {
              // liked, do codes here
          }
          else {
              // not yet liked, show like button
          }
      }
  );
  </code></pre>
  
  <p>I have applied some of the suggestions found here and the script still doesn't work for some users. I am out of clue what particular account/privacy/app setting should be modified to allow querying of the user's page likes, apart from setting the 'user_likes' in the App's user and friend permissions settings.</p>