-5
나는 facebook-invite-friends-api에서 페이스 북의 초대 상자를 구현했다. 그러나 (9lesson) 페이스 북 알림 데모에서 보여준대로 내 웹 사이트로 리디렉션하는 방법을 얻을 수 없다. 어떻게 도와 드릴까요?facebook 앱에서 내 웹 사이트로 리디렉션하는 방법은 무엇입니까?
내 코드는 다음과 같습니다
<div id="fb-root">
</div>
<a href="javascript:void(0);" onclick="FbRequest('If you want to fulfill your wishes then do not miss the opertuanty, huury up and join WishIsDone, A platform where you can fulfill your as well as your friends wishes...!','609416079110673');">
Send Request</a>
<script type="text/javascript">
function FbRequest(message, data) {
FB.ui({ method: 'apprequests', message: message, data: data, title: 'Share this site with your friends' },
function (response) {
// response.request_ids holds an array of user ids that received the request
var receiverIDs;
if (response.request) {
var receiverIDs = response.to; // receiverIDs is an array holding all user ids
alert(receiverIDs);
}
}
);
}
// typical application initialization code for your site
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
window.fbAsyncInit = function() {
FB.init({
appId: '******',
session: {},
status: true,
cookie: true,
xfbml: true
});
};
</script>
내 로그인 페이지 코드 : 초대 중 하나에 사용자가 클릭이, 그들은 응용 프로그램의 캔버스 URL로 전송됩니다
기본적으로<script type='text/javascript'>
if (top.location != self.location) {
top.location = self.location
}
</script>
위의 코드를 로그인 페이지에 추가했지만 필요한 결과를 얻을 수 없습니다. –
콘솔에 JS 오류가 있습니까? 사용자가 실제로 로그인 페이지에 도착합니까? – Lix
나는 그걸 확인하기 위해 경보를 사용했으나 화재 경보도 있습니다. 그래서 로그인 페이지에 도착한다고 말할 수는 없지만 그것을 내 웹 사이트의 기본 페이지로 설정했습니다. 캔버스 URL을 다음과 같이 입력했습니다 :: http://subdomain.domian.com/foldername/ –