Presentation on how to chat with PDF using ChatGPT code interpreter
Implementing Gamification Platform
1. Implementing the beintoo Gamification
Platform in Titanium
Alessio Ricco
@alessioricco
sabato 23 febbraio 13
2. Implementing the Beintoo Gamification Platform in Titanium
Beintoo: developer point of view
Gamification Platform
•cross apps user profile
•score
•leaderboards
•achievements
•and ....
@alessioricco
sabato 23 febbraio 13
3. Implementing the Beintoo Gamification Platform in Titanium
Beintoo: 3 actors
Users
they have a shared social profile and reputation
Redeem goods
Developers
gamification api
monetization
Apps
cross app promotion nework
user engagement
@alessioricco
sabato 23 febbraio 13
4. 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.
@alessioricco
sabato 23 febbraio 13
5. Implementing the Beintoo Gamification Platform in Titanium
Contests / Leaderboards
@alessioricco
sabato 23 febbraio 13
6. Implementing the Beintoo Gamification Platform in Titanium
Contests / Leaderboards
@alessioricco
sabato 23 febbraio 13
7. Implementing the Beintoo Gamification Platform in Titanium
Achievements
@alessioricco
sabato 23 febbraio 13
8. Implementing the Beintoo Gamification Platform in Titanium
Achievements
@alessioricco
sabato 23 febbraio 13
9. Implementing the Beintoo Gamification Platform in Titanium
Achievements
@alessioricco
sabato 23 febbraio 13
10. Implementing the Beintoo Gamification Platform in Titanium
Promote your Apps throuhout the Beintoo Network
Cross Apps promotion network
@alessioricco
sabato 23 febbraio 13
11. 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.
@alessioricco
sabato 23 febbraio 13
12. Implementing the Beintoo Gamification Platform in Titanium
Titanium 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;
}
@alessioricco
sabato 23 febbraio 13
13. Implementing the Beintoo Gamification Platform in Titanium
Differences between a Player and a User
•User
has subscribed to Beintoo
has inserted his Email
•Player
player is a generic user who hasn’t connected to beintoo yet
A user could be connected to several players
@alessioricco
sabato 23 febbraio 13
14. 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/login
auth
apikey : your app apikey
userExt: the user id, which may be null if the player isn’t logged in beintoo
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.
guid: a string that uniquely identify this player in your app
params
language : (optional) the player language, using ISO639-1 standard
publicname: (optional) a human-readable string identifying the player
@alessioricco
sabato 23 febbraio 13
15. Implementing the Beintoo Gamification Platform in Titanium
Titanium 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);
}
@alessioricco
sabato 23 febbraio 13
16. Implementing the Beintoo Gamification Platform in Titanium
Beintoo API: User Set (registration)
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.
User.setUser
url
https://api.beintoo.com/api/rest/user/set
auth (request header)
apikey: your app apikey
params (POST)
email: mandatory, return error if a user with that email is already registered or the email is not valid
address: optional
country: optional, String, ISO 3166-1-alpha-2 code
gender: optional, integer, 1=male, 2=female
nickname: optional
name: optional
password: optional, will be generated automatically if not provided
sendGreetingsEmail: optional, default true, whether or not to send a greeting email to the new user
imageURL: optional, URL of userimage
@alessioricco
sabato 23 febbraio 13
17. 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);
}
@alessioricco
sabato 23 febbraio 13
18. 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.
url
https://api.beintoo.com/api/rest/player/submitscore
auth (request header)
apikey : your app apikey
guid : 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.
params
lastScore : the last game session score.
balance : (optional) if you have a lifetime total score for that player.
latitude, longitude, radius: (optional) geolocation information.
@alessioricco
sabato 23 febbraio 13
19. 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);
}
@alessioricco
sabato 23 febbraio 13
20. Implementing the Beintoo Gamification Platform in Titanium
Beintoo API: App.leaderboard
returns a map with your players and the score of those.
URL
https://api.beintoo.com/api/rest/app/leaderboard
auth
apikey: your app apikey
codeID: (optional) a string that represents the position in your code. We will use it to identify different
api calls of the same nature.
params
start: 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 STANDARD
languageISO: a ISO 639.1 language identifier for app-personalized feed, if any
@alessioricco
sabato 23 febbraio 13
21. 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);
}
@alessioricco
sabato 23 febbraio 13
22. Implementing the Beintoo Gamification Platform in Titanium
Titanium-Beintoo sample app
https://github.com/alessioricco/titanium-beintoo
@alessioricco
sabato 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
@alessioricco
sabato 23 febbraio 13
24. Implementing the Beintoo Gamification Platform in Titanium
Alessio Ricco
Wallive ltd Software Engineer
Titanium Certified App Developer
Titan
Ti.Roma - Roma Titanium Mobile Meetup
Etnatraining trainer and senior consultant
Apps
•TwinsMatcher
•Rassegna Stampa Politica Italiana
•CrowdFuture
http://alessioricco.com
http://www.linkedin.com/in/alessioricco
http://www.slideshare.net/alessioricco
@alessioricco
sabato 23 febbraio 13