我想我会疯了.我无法让它发挥作用.
我只想检查用户是否喜欢我的iFrame应用程序中的javascript页面.
FB.api({
method: "pages.isFan",
page_id: my_page_id,
}, function(response) {
console.log(response);
if(response){
alert('You Likey');
} else {
alert('You not Likey :(');
}
}
);
Run Code Online (Sandbox Code Playgroud)
返回:False
但我是我的页面的粉丝,所以不应该返回true?!
我正在尝试创建一个Facebook iFrame应用程序.应用程序应首先显示图像,如果用户喜欢该页面,他将可以访问某些内容.
我使用RoR,因此我无法使用Facebook PhP SDK.
当用户不喜欢该页面时,这是我的iFrame HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
body {
width:520px;
margin:0; padding:0; border:0;
font-family: verdana;
background:url(repeat.png) repeat;
margin-bottom:10px;
}
p, h1 {width:450px; margin-left:50px; color:#FFF;}
p {font-size:11px;}
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
</head>
<body>
<div id="container">
<img src="welcome.png" alt="Frontimg">
</div>
Run Code Online (Sandbox Code Playgroud)
并且,如果用户喜欢该页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
body …Run Code Online (Sandbox Code Playgroud)