Squaby Demo
import Felgo 4.0
Facebook {
id: facebook
appId: "1514388122117426"
readPermissions: ["email", "read_friendlists"]
publishPermissions: ["publish_actions"]
property string vplayPageLink: system.isPlatform(System.IOS) ? "fb://profile/392046547517903" : "http://www.facebook.com/felgo"
property string squabyPageLink: "http://www.facebook.com/squabydefense"
onSessionStateChanged: {
console.log("Facebook: New Facebook Session state: ", sessionState);
}
onGetGraphRequestFinished: {
if (resultState === Facebook.ResultOk) {
}
else if (resultState === Facebook.ResultInvalidSession) {
console.debug("Facebook: No active session, call openSession beforehand.");
}
else {
console.debug("Facebook: There was an error retrieving the friend list.");
}
}
onPostGraphRequestFinished: {
console.debug("Facebook: onPostGraphRequestFinished: graphPath:" + graphPath + ", resultState:" + resultState + ", result:" + result);
}
function sendNewHighscoreToUserWall(newHighscore) {
facebook.postGraphRequest( "me/feed",
{ "link" : vplayPageLink,
"name" : "New Squaby highscore",
"description": "Squaby is a tower defense game for iOS & Android - you can download it from the App Store!",
"message" : "I just got a new highscore in Squaby: " + newHighscore + " points! Can you beat me?"
} )
}
function postOpinionToUserWall() {
}
function openVPlayFacebookSite() {