-
Notifications
You must be signed in to change notification settings - Fork 1
/
access.js
57 lines (55 loc) · 1.62 KB
/
access.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//Apple ID login
window.fbAsyncInit = function()
{
FB.init({
appId : '341086482753224',
xfbml : true,
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
version : 'v2.2'
});
};
//don't know what this does but don't touch it
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
//login
var permission = "email,read_friendlists,user_status,user_likes,user_relationships,user_about_me,user_birthday,friends_status,read_stream,manage_notifications,publish_actions,user_groups,user_events";
function Login()
{
FB.login(function(response)
{
if (response.authResponse)
{
var access_token = FB.getAuthResponse()['accessToken'];
//console.log('Access Token = '+ access_token);
FB.api('/me', function(response)
{
console.log('Good to see you, '+ response.name+ '.');
});
getUserInfo();
//getPermissions();
}
else
{
console.log('User cancelled login or did not fully authorize.');
}
},{scope: permission});
}
//////////////////////////////////////////////////
function Logout()
{
FB.logout(function(){document.location.reload();});
}
///////////////////////////////////////////////////
/*
function getPermissions()
{
FB.api('/me/permissions', function(response) {
console.log(response);
});
}*/