1

我正在开发一个与 facebook 集成的移动应用程序。该应用程序是使用 jquery mobile 开发的(见下文)

<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');       
        }
});

在移动设备上,请求对话框不会弹出。我只看到一个空白的白色屏幕。有谁知道我做错了什么?

4

1 回答 1

0

在尝试了几件事之后,似乎问题出在手机的页面高度以及对话框在屏幕上的位置。

我使用以下方法修复了我的 nexus5:

添加了一个页面:

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

CSS:

#fb-page {
    position: initial;
}
于 2014-12-02T21:15:42.253 回答