3
여기 ios와 Phonegap의 Facebook 자바 스크립트 SDK?
<html>
<head>
<head>
<title></title>
<script type="text/javascript" charset="utf-8" src="cordova-1.6.0.js"></script>
<script type="text/javascript">
function go()
{
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
});
}
</script>
<body>
<div id="fb-root">
</div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '', // App ID
channelUrl : '', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
oauth : true //oauth v2.0
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<input onclick="go();" type='submit' id='login-button' value='Login' name='login' >
</body>
</html>
은 기본적으로 버튼을 클릭하고 당신에게 로그인 팝업을 표시해야합니다 내 코드입니다. 그것은 정상적인 브라우저에서 시도 할 때 작동하지만 아이폰 시뮬레이터에서 시도 할 때 아무 일도 일어나지 않습니다. Iv는 또한 팝업을 허용하도록 iPhone 브라우저를 설정합니다. 내가 도대체 뭘 잘못하고있는 겁니까?
javascript SDK 이외의 다른 것을 사용해야합니까? – mgm8870
일부 세부 사항은 정말 좋을 것입니다. 위의 수정 된 버전을 쳐다 보면 내 투표가 있습니다. –