【发布时间】:2013-06-16 17:35:39
【问题描述】:
我想在同一网页中打开 Facebook 的 oauth 对话框。
实际上,我在我的 WIN32 (C++) 项目中嵌入了一个静态 html 页面,并且我正在使用 Facebooks 的 JS SDK 来执行 oauth 操作,因为 IE 无法承受 url 长度超过 2K(大约)。
显示选项 popup 和 touch 工作正常,但选项 page 和 iframe 不工作。
这里是代码;
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '*************', // App ID
channelUrl : 'file:///D:/channel.htm', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.ui(
{
method: 'oauth',
name: 'Facebook Dialogs',
link: 'http://localhost',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
display: 'page'
},
function(response) {
if (response && response.post_id) {
//alert('Post was published.');
} else {
//alert('Post was not published.');
}
}
);
};
</script>
请任何人告诉我,我在上述代码中缺少什么以在同一网页中打开 oauth 对话框。
谢谢, 斯卡尔。
【问题讨论】:
标签: c++ facebook winapi oauth facebook-javascript-sdk