2012-04-10 169 views
1

我正在開發與Facebook集成的移動應用程序。該應用程序與jQuery Mobile的開發(見下文)Facebook FB.ui apprequest未在移動設備上顯示

<link rel="stylesheet" <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script> 

我到目前爲止已經成功地Facebook的功能與Facebook JSSDK和正常的瀏覽器的所有作品集成,因爲它應該(登錄,註銷,其他API調用) ,但是當我嘗試發送apprequest時:

function sendRequest() { 
    FB.ui({ method: 'apprequests', message: 'Are you ready?', 
    }, function(response) { 
    console.log('sendRequest response: ', response); 
    if (response && response.to) { 
     for (var j = 0; j < response.to.length; j++) { 
    alert('You have: ' + response.response.name + ' with User id: ' + response.to[j] + ' invited'); 
     //alert(response.to[j]); 
     } 
    } else { 
      console.log('User didn't invite anyone');  
     } 
}); 

在移動設備上,請求對話框不會彈出。我只看到一個空白的白色屏幕。 有沒有人有一個想法我做錯了什麼?

+0

這是一個錯誤的CSS :) – 2012-04-12 07:18:07

+0

那麼,答案是什麼?我有類似的問題。 – Paul 2012-07-20 04:31:37

+0

我也有類似的問題... – 2012-09-01 13:59:57

回答

0

嘗試了幾件事情後,似乎問題是與移動的頁面高度和對話框在屏幕上的位置。

我用下面的對我nexus5修復:

添加的網頁:

<div data-role="page" id="fb-page"> 
    <div id="fb-root"></div> 
</div> 

CSS:

#fb-page { 
    position: initial; 
}