나는 fb 앱을 만듭니다. FB.ui 메소드 apprequests를 사용하여 내가 보낸 사람에게 친구를 선택하고 벽에 게시하고 싶습니다. 이것은 이렇게 보입니다.
<div id="fb-root"></div>
<script src="http://connect.facebook.net/pl_PL/all.js" type="text/javascript"></script>
<script type="text/javascript" >
FB.init({
appId: myappID,
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true, // parse XFBML
channelUrl : 'http://localhost:3435/Content/channel.html'
});
function invite(){
FB.ui({ method: 'apprequests',
message: 'You should learn more about this awesome game.',
data: 'tracking information for the user'
},
function (response) {
if (response && response.request_ids) {
len = response.request_ids.length; //# of reqs
var i = 0;
for (i = 0; i < len; i++) {
user_req_id = response.request_ids[i];
FB.api('/me/apprequests/?request_ids=' + toString(user_req_id),
function (response) {
$.post("http://localhost:3435/Home/PostToWall",
{ request_ids: response['data'][0]['from']['id'] },
function (data) { alert("Data Loaded: " + data); }
);
});
}
} else {
// alert('Post was not published.');
}
})
};
</script>
당신이 난이 크롬과 파이어 폭스와 잘 작동하는
[HttpPost, CanvasAuthorize(Permissions = "user_about_me,publish_stream,email")]
public ActionResult PostToWall(string request_ids)
{
/* Post to Wall Logic */
return View();
}
에 POST 요청을하고 싶어하지만, IE에서 동작이 해고되지 볼 수 있듯이.
테스트 할 수있는 작은 샘플 자바 스크립트를 준비했습니다. 이것은 문제가있는 곳입니다.
이 FF와 크롬에서 테스트<script type="text/javascript" >
function CallPostToWall() {
$.post("http://localhost:3435/Home/PostToWall",
{ request_ids: 100001968250722 },
function (data) { alert("Data Loaded: " + data);}
);
};
</script>
<a href='#' onclick='CallPostToWall()'>Test Posting</a>
, 경고는 조치를 http://localhost:3435/Home/PostToWall?request_ids=100001968250722 요청한 같은 경우 예상되는 HTML을 반환합니다.
반면에 IE에서는. 나는 다음과 같은 것을 얻는다 :
<html><head><script type="text/javascript">
top.location = "http://www.facebook.com/dialog/oauth/?scope=user_about_me,publish_stream,email&state=eyJyIjoiaHR0cDovL2FwcHMuZmFjZWJvb2suY29tL2NoaW5jenlrd3Nvc2llL0hvbWUvUG9zdFRvV2FsbCJ9&client_id=248066421875572&redirect_uri=http://localhost:3435/facebookredirect.axd";
</script></head><body></body></html>
나는 꽤 이것과 함께진다.
의견이 있으십니까?
감사합니다, 사이먼
Google은 사용자 컴퓨터에있는 원인을 테스트 할 수 없으므로 액세스 할 수 없습니다. –
그것이 테스트 코드를 제공 한 이유입니다. 다른 샘플과 함께 사용할 수 있습니다. Facebook-C# -SDK 프로젝트 –
무엇을보고 싶습니까? –