I create a new html file and input the code given in Mobile Web Tutorial
I follow all the instructions in “Getting Started” section to login
<html>
<head>
<title>My Facebook</title>
<meta name="viewport"
content="initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<style>
body.connected #login { display: none; }
body.connected #logout { display: block; }
body.not_connected #login { display: block; }
body.not_connected #logout { display: none; }
</style>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'blahblah, // App ID
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Event.subscribe('auth.statusChange', handleStatusChange);
};
// 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>
<div id="login">
<p><button onClick="loginUser();">Login</button></p>
</div>
<div id="logout">
<p><button onClick="FB.logout();">Logout</button></p>
</div>
<script>
function loginUser() {
FB.login(function(response) { }, {scope:'email'});
}
</script>
</body>
</html>
but it doesn’t work
i only change appID
do i miss something?
i follow and doesn’t do anything else
You should continue with the next steps in the tutorial to get functional results. It looks like you stopped halfway at the login step of the tutorial.
I also updated the domain info in the line under the appID line.
And make sure you test on a mobile browser or on desktop that you set the user agent. See https://developers.facebook.com/docs/guides/mobile/web/#test for instructions.
I wasn’t able to see my profile photo and my name and other things like friends names until I tried it on my iPhone.