, FB , , . - -. , Facebook, , . : FB: https://developers.facebook.com/docs/authentication/, , Android: https://developers.facebook.com/docs/mobile/android/sso/
JavaScript- ( MVC3), https://developers.facebook.com/docs/authentication/client-side/ . .
<div id="fb-root"></div>
<script>
(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));
window.fbAsyncInit = function () {
FB.init({
appId: '@EventController.FB_APP_ID',
channelUrl: '//' + window.location.hostname + '/channel.htm',
status: false,
cookie: false,
xfbml: false
});
FB.Event.subscribe('auth.statusChange', function (response) {
if (response.authResponse) {
FB.api('/me', function (me) {
})
} else {
}
});
document.getElementById('auth-loginlink').addEventListener('click', function () {
FB.login(function (response) {
if (response.authResponse != null) {
var token = response.authResponse.accessToken;
} else {
}
}, { scope: 'manage_pages,publish_stream' });
});
};
</script>
- FB URL ( http://localhost/) → → URL- -. channel.htm :
<script src="//connect.facebook.net/en_US/all.js">