forked from gjrmacedo/caronasWebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testeAuth.html
64 lines (54 loc) · 1.44 KB
/
testeAuth.html
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
58
59
60
61
62
63
64
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Basic Facebook Login</title>
<script>
// funcao sera chamada quando usuario finalizar o processo executado
// pelo botao de Login
function checkLoginState()
{
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// usuario logado no facebook e com o app aceito
} else if (response.status === 'not_authorized') {
// Usuario logado no facebook, mas nao aceitou o App
} else {
// Usuario nao logado no facebook
}
});
}
</script>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '1524561077858163',
xfbml : true,
version : 'v2.5'
});
};
(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'));
function teste() {
FB.api('/me', function(response) {
alert("ID: "+response.id);
var img_link = "http://graph.facebook.com/"+response.id+"/picture"
});
}
</script>
</head>
<body>
<div
class="fb-like"
data-share="true"
data-width="450"
data-show-faces="true">
</div>
<button onclick="teste();">ID DO USUÁRIOS</button>
</body>
</html>