Facebook Login with EVRYTHNG
JavaScript
Evt = new Evrythng({
// You app API key
evrythngApiKey: '239420083518650'
});
Evt.fbLogin(function(fbData) {
// With the response from Facebook (which contains the access tokens we
// need for the user), go ahead and register this user with the
// EVRYTHNG engine...
Evt.authFacebook({
data: {
access: {
token: fbData.authResponse.accessToken
}
}
}, function(evtData) {
// We now check the Facebook (and EVRYTHNG) user into the Fussball table
Evt.checkin({
type: 'checkin',
evrythngApiKey: evtData.apiKey
thng: Evt.getParam('thngId')
}, function(data) {
// Get the score from EVRYTHNG and COMPOSE
[...]
// Now publish the score on Facebook
fbPost({
message: "Score here"
link: "http://YOUR-APP-URL.com",
name: "Fussball Score",
description: "Spontaneously Smart Fussball Table"
});
})})