Titanium Mobile and Beintoo

  • 1,327 views
Uploaded on

slides from tiConf 2013 in Valencia. …

slides from tiConf 2013 in Valencia.
Implementing the Beintoo Gamification Platform in Titanium

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,327
On Slideshare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
12
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Implementing the beintoo Gamification Platform in Titanium Alessio Ricco@alessioriccosabato 23 febbraio 13
  • 2. Implementing the Beintoo Gamification Platform in TitaniumBeintoo: developer point of viewGamification Platform•cross apps user profile•score•leaderboards•achievements•and ....@alessioriccosabato 23 febbraio 13
  • 3. Implementing the Beintoo Gamification Platform in TitaniumBeintoo: 3 actors Users they have a shared social profile and reputation Redeem goods Developers gamification api monetization Apps cross app promotion nework user engagement@alessioriccosabato 23 febbraio 13
  • 4. Implementing the Beintoo Gamification Platform in TitaniumGamificationThe ideas are quite simple: Users have a cross-apps profile on Beintoo.com where theyshare their achievements and rewards on gamified apps, and where they can followtheir social graph friends and engage with them.Activities such as increase of score, change in rank of an app leaderboard, loyalty andcompletion of a level in a game will be seen by all Beintoo users.That creates a reputation layer, such that users are pushed to reach achievementswhich are then published and seen by the entire community.People can also challenge friends, create contests, send messages, rate or share, andabove all get a cross apps use, constantly increasing the Apps engagement.This way users will have cross app achievements and a cross app reputation and willbe able to check their stats in all their favourite apps.@alessioriccosabato 23 febbraio 13
  • 5. Implementing the Beintoo Gamification Platform in TitaniumContests / Leaderboards@alessioriccosabato 23 febbraio 13
  • 6. Implementing the Beintoo Gamification Platform in TitaniumContests / Leaderboards@alessioriccosabato 23 febbraio 13
  • 7. Implementing the Beintoo Gamification Platform in TitaniumAchievements@alessioriccosabato 23 febbraio 13
  • 8. Implementing the Beintoo Gamification Platform in TitaniumAchievements@alessioriccosabato 23 febbraio 13
  • 9. Implementing the Beintoo Gamification Platform in TitaniumAchievements@alessioriccosabato 23 febbraio 13
  • 10. Implementing the Beintoo Gamification Platform in TitaniumPromote your Apps throuhout the Beintoo Network Cross Apps promotion network@alessioriccosabato 23 febbraio 13
  • 11. Implementing the Beintoo Gamification Platform in TitaniumMonetization Beintoo is an environment in which people will get real world opportunities from their virtual activities. As said before, developers will be able to rank users through beintoo scoring algorithms, to introduce achievements in their apps/games and to distribute rewards as virtual goods to their best and most loyal users. This way they are introduced to a network of distribution of virtual/real goods: a new innovative opportunity for monetization. In fact, developers monetize because once advertisers pay beintoo the delivery of the branded virtual goods and the redemption of the real coupons, Beintoo pay back developers 70% of their revenues.@alessioriccosabato 23 febbraio 13
  • 12. Implementing the Beintoo Gamification Platform in TitaniumTitanium Code: BeintooRest exports.beintooREST = function(cmd, url, headers, callbackSuccess, callbackError) { var xhr_task = Ti.Network.createHTTPClient(); xhr_task.timeout = TIMEOUT; xhr_task.open(cmd,url); xhr_task.setRequestHeader(apikey,API); if (headers) { for(var i=0,j=headers.length; i<j; i++){ xhr_task.setRequestHeader(headers[i].key,headers[i].value); }; } xhr_task.onload = function() { if (callbackSuccess) { var o = JSON.parse(this.responseText); callbackSuccess(o); } }; xhr_task.onerror = function() { if (callbackError) { // handle the error... } }; xhr_task.send(); return true; }@alessioriccosabato 23 febbraio 13
  • 13. Implementing the Beintoo Gamification Platform in TitaniumDifferences between a Player and a User•Userhas subscribed to Beintoohas inserted his Email•Playerplayer is a generic user who hasn’t connected to beintoo yetA user could be connected to several players@alessioriccosabato 23 febbraio 13
  • 14. Implementing the Beintoo Gamification Platform in TitaniumBeintoo API: Player.loginuse this function whenever a user opens yourapplications, it will return the player id (called guid,which is unique for each of your player). Extract the guidfrom the returned object.urlhttps://api.beintoo.com/api/rest/player/loginauthapikey : your app apikeyuserExt: the user id, which may be null if the player isn’t logged in beintoodeviceUUID : (optional) the deviceID , if you have access to it.codeID : (optional)  a string that represents the position in your code. We will use it to identify differentapi calls of the same nature.guid: a string that uniquely identify this player in your appparamslanguage : (optional) the player language, using ISO639-1 standardpublicname: (optional) a human-readable string identifying the player@alessioriccosabato 23 febbraio 13
  • 15. Implementing the Beintoo Gamification Platform in TitaniumTitanium Code: PlayerLogin exports.playerLogin = function(callbackSuccess, callbackError) { // before to login, Am I a user? var userId = exports.getUserId(); var headers = null; if (userId) { headers = [{ key : userExt, value : userId }]; } else { var player = exports.getPlayer(); //Am I a player ? if (player) { var guid = player.guid; headers = [{ key : guid, value : guid }]; } // else I’m a new player } exports.beintooREST(GET, https://api.beintoo.com/api/rest/player/login, headers, callbackSuccess, callbackError); }@alessioriccosabato 23 febbraio 13
  • 16. Implementing the Beintoo Gamification Platform in TitaniumBeintoo API: User Set (registration)You can use this method to automatize the user-registration of one of your player, providing us someinformation.Be aware that this method uses POST, not GET method.User.setUserurlhttps://api.beintoo.com/api/rest/user/setauth (request header)apikey: your app apikeyparams (POST)email: mandatory, return error if a user with that email is already registered or the email is not validaddress: optionalcountry: optional, String, ISO 3166-1-alpha-2 codegender: optional, integer, 1=male, 2=femalenickname: optionalname: optionalpassword: optional, will be generated automatically if not providedsendGreetingsEmail: optional, default true, whether or not to send a greeting email to the new userimageURL: optional, URL of userimage@alessioriccosabato 23 febbraio 13
  • 17. Implementing the Beintoo Gamification Platform in TitaniumTitanium Code: userSet exports.userSet = function(email, nickname, password, callbackSuccess, callbackError) { var player = exports.getPlayer(); if (player == null) { alert("You need to have a player object"); return; } var headers = [{ key : guid, value : player.guid }]; var postParam = { email : email, password : password, sendGreetingsEmail : "true", nickname : nickname }; exports.beintooREST(POST, https://api.beintoo.com/api/rest/user/set/, headers, callbackSuccess, callbackError, postParam); }@alessioriccosabato 23 febbraio 13
  • 18. Implementing the Beintoo Gamification Platform in TitaniumBeintoo API: Player.submitScoreuse this function whenever you want to submit score,i.e. each time your player ends a game.After every submit score we automatically assignBedollars to the user through internal algorithms.urlhttps://api.beintoo.com/api/rest/player/submitscoreauth (request header)apikey : your app apikeyguid : the unique player id, on your app side.deviceUUID : (optional) the deviceID , if you have access to it.codeID : (optional)  a string that represents the position in your code. We will use it to identify differentapi calls of the same nature. It is pretty important in submitscore, as the score id codeID dependant. Inthis way you can send different kind of scoring, one for each codeID.paramslastScore : the last game session score.balance : (optional)  if you have a lifetime total score for that player.latitude, longitude, radius: (optional) geolocation information.@alessioriccosabato 23 febbraio 13
  • 19. Implementing the Beintoo Gamification Platform in TitaniumTitanium Code: submitScore exports.submitScore = function(score, contest, callbackSuccess, callbackError) { var player = exports.getPlayer(); if (player == null) { alert("You need to have a player object"); return; } var headers = []; headers.push({ key : guid, value : player.guid }); if (contest) { headers.push({ key : codeID, value : contest }); } exports.beintooREST(GET, https://api.beintoo.com/api/rest/player/submitscore/? lastScore= + score, headers, callbackSuccess, callbackError); }@alessioriccosabato 23 febbraio 13
  • 20. Implementing the Beintoo Gamification Platform in TitaniumBeintoo API: App.leaderboardreturns a map with your players and the score of those.URLhttps://api.beintoo.com/api/rest/app/leaderboardauthapikey: your app apikeycodeID: (optional)  a string that represents the position in your code. We will use it to identify differentapi calls of the same nature.paramsstart: used for page layout, it states the row at which the leaderboard should start (let’s say from 10thon)rows: the maximum number of results (max is set to 50, default 20)kind: • STANDARD: standard leaderboard • FRIENDS: shows your and your friends leaderboards • GPS: shows leaderboard of users geolocated near to you • CLOSEST: shows leaderboard of users around you (let’s say 5 before your position and 5 after if rows was set to 10)userExt (HEADER): necessary to filter if kind is not STANDARDlanguageISO: a ISO 639.1 language identifier for app-personalized feed, if any@alessioriccosabato 23 febbraio 13
  • 21. Implementing the Beintoo Gamification Platform in TitaniumTitanium Code: getLeaderBoardexports.getLeaderBoard =function(callbackSuccess, callbackError) { var headers = null; exports.beintooREST(GET, https://api.beintoo.com/api/rest/app/leaderboard?kind=STANDARD, headers, callbackSuccess,callbackError);}@alessioriccosabato 23 febbraio 13
  • 22. Implementing the Beintoo Gamification Platform in TitaniumTitanium-Beintoo sample app https://github.com/alessioricco/titanium-beintoo@alessioriccosabato 23 febbraio 13
  • 23. Implementing the Beintoo Gamification Platform in Titanium complete source code https://github.com/alessioricco/titanium-beintoo beintoo http://www.beintoo.com/v2/home API documents http://documentation.beintoo.com/home/api-docs/resources Twinsmatcher https://itunes.apple.com/app/twinsmatcher/id429890747?mt=8@alessioriccosabato 23 febbraio 13
  • 24. Implementing the Beintoo Gamification Platform in TitaniumAlessio RiccoWallive ltd Software EngineerTitanium Certified App DeveloperTitanTi.Roma - Roma Titanium Mobile MeetupEtnatraining trainer and senior consultantApps•TwinsMatcher•Rassegna Stampa Politica Italiana•CrowdFuturehttp://alessioricco.comhttp://www.linkedin.com/in/alessioriccohttp://www.slideshare.net/alessioricco@alessioriccosabato 23 febbraio 13