titanium mobile and beintoo

24
@alessioricco Implementing the beintoo Gamification Platform in Titanium Alessio Ricco sabato 23 febbraio 13

Upload: alessio-ricco

Post on 09-May-2015

1.415 views

Category:

Technology


4 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Titanium Mobile and Beintoo

@alessioricco

Implementing the beintoo Gamification Platform in Titanium

Alessio Ricco

sabato 23 febbraio 13

Page 2: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Gamification Platform

•cross apps user profile•score•leaderboards•achievements•and ....

Beintoo: developer point of view

sabato 23 febbraio 13

Page 3: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Beintoo: 3 actors

Usersthey have a shared social profile and reputationRedeem goods

Developersgamification apimonetization

Appscross app promotion neworkuser engagement

sabato 23 febbraio 13

Page 4: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Gamification

The ideas are quite simple: Users have a cross-apps profile on Beintoo.com where they share their achievements and rewards on gamified apps, and where they can follow their social graph friends and engage with them.

Activities such as increase of score, change in rank of an app leaderboard, loyalty and completion 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 achievements which are then published and seen by the entire community.

People can also challenge friends, create contests, send messages, rate or share, and above 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 will be able to check their stats in all their favourite apps.

sabato 23 febbraio 13

Page 5: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Contests / Leaderboards

sabato 23 febbraio 13

Page 6: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Contests / Leaderboards

sabato 23 febbraio 13

Page 7: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Achievements

sabato 23 febbraio 13

Page 8: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Achievements

sabato 23 febbraio 13

Page 9: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Achievements

sabato 23 febbraio 13

Page 10: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Promote your Apps throuhout the Beintoo Network

Cross Apps promotion network

sabato 23 febbraio 13

Page 11: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Monetization

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.

sabato 23 febbraio 13

Page 12: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

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;}

Titanium Code: BeintooRest

sabato 23 febbraio 13

Page 13: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Differences between a Player and a User

•Userhas subscribed to Beintoohas inserted his Email

•Playerplayer is a generic user who hasn’t connected to beintoo yet

A user could be connected to several players

sabato 23 febbraio 13

Page 14: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Beintoo API: Player.login

use this function whenever a user opens your applications, it will return the player id (called guid, which is unique for each of your player). Extract the guid from the returned object.url https://api.beintoo.com/api/rest/player/loginauth apikey : 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 different api 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

sabato 23 febbraio 13

Page 15: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Titanium Code: PlayerLoginexports.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);}

sabato 23 febbraio 13

Page 16: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Beintoo API: User Set (registration)

User.setUser url https://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

You can use this method to automatize the user-registration of one of your player, providing us some information.Be aware that this method uses POST, not GET method.

sabato 23 febbraio 13

Page 17: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Titanium 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);}

sabato 23 febbraio 13

Page 18: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Beintoo API: Player.submitScore

use this function whenever you want to submit score, i.e. each time your player ends a game.After every submit score we automatically assign Bedollars 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 different api calls of the same nature. It is pretty important in submitscore, as the score id codeID dependant. In this 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.

sabato 23 febbraio 13

Page 19: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Titanium 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);}

sabato 23 febbraio 13

Page 20: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Beintoo API: App.leaderboard

returns a map with your players and the score of those.

URLhttps://api.beintoo.com/api/rest/app/leaderboardauth apikey: your app apikeycodeID: (optional)  a string that represents the position in your code. We will use it to identify different api calls of the same nature.paramsstart: used for page layout, it states the row at which the leaderboard should start (let’s say from 10th on)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

sabato 23 febbraio 13

Page 21: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Titanium Code: getLeaderBoard

exports.getLeaderBoard = function(callbackSuccess, callbackError) {

var headers = null; exports.beintooREST('GET', 'https://api.beintoo.com/api/rest/app/leaderboard?kind=STANDARD', headers, callbackSuccess, callbackError);

}

sabato 23 febbraio 13

Page 22: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Titanium-Beintoo sample app

https://github.com/alessioricco/titanium-beintoo

sabato 23 febbraio 13

Page 24: Titanium Mobile and Beintoo

@alessioricco

Implementing the Beintoo Gamification Platform in Titanium

Alessio Ricco Wallive ltd Software Engineer

Titanium Certified App DeveloperTitanTi.Roma - Roma Titanium Mobile Meetup Etnatraining trainer and senior consultant

Apps•TwinsMatcher•Rassegna Stampa Politica Italiana•CrowdFuture

http://alessioricco.comhttp://www.linkedin.com/in/alessioriccohttp://www.slideshare.net/alessioricco

sabato 23 febbraio 13