Trophy Life is a Facebook application built for the Android OS. It extends upon the "Check In" phenomenon by allowing users to create a virtual trophy that can be claimed when a certain activity is performed at a certain location. A good example would be a back yard party. The host could create a trophy such as "Crashed Joe's Backyard Bash" and through a variety ways attach experience points to the trophy. The host might even add a password, and a time span in which the trophy must be claimed. Users of the application who are within GPS distance, and have the appropriate credentials can claim this trophy, earn experience points, and level up in one of many categories, in this case "Festive".

Why Drupal was chosen: 

A back-end server would be needed as a database for created trophies, and for claimed trophies. The same back-end server would also work well displaying activity within the application. Given Drupal's track record as an excellent content management system and it's capacity to serve as a back-end server using the Services Module, it was adopted. In addition, the need to inject content into social networks (Currently only Facebook) and Drupal's excellent modules dealing with this, it was felt to be the prime candidate.

Describe the project (goals, requirements and outcome): 

A back-end server facilitating the actions of the Android application was needed. The server would need to be able to store the actions of the app, while at the same time displaying them in a manner outside of the application context, a virtual mirror if you will. A system would have to exist whereby users of the application could log into Drupal using services, but at the same time, not have access to the back-end server. In addition there would need to be a link between Facebook, Trophy Life, and the back-end server. Another reason I wanted to use Drupal as both a mirror into the app, and as a back-end server was it's capacity to display information in a matter that would be attractive to anyone trying to promote anything. Using Trophy Life, data could be posted to a server, with context and a web link, and displayed in a nicely themed manner. The same information could be served back to the app using the Services Module and be nicely displayed there. The value of the webpage mainly lies with the ability to create extremely cheap contextual links. In addition, user capture of the trophy would then be injected into the Facebook Network with links back to the original trophy webpage on the back-end server.

Services Module is an incredible thing. I created a custom module which created a custom service that over-rides the usual user login. A token is passed from the android app, to the server. This is checked on every login and if token is lacking or wrong, login is aborted. I got this idea from the CSRF token used within the latest Services module. This requirement is role dependent giving administrators the ability to login into the back-end server through the main Drupal login block. A clean up method searches for flagged accounts that failed the token check and deletes them from the system on every cron run (Talk about great spam protection). This module is available in my sandbox, I just have not had time to purify it enough to find a project page. Services Login Limiter

Trophy Life first queries Facebook, and creates a login there, It then acquires the Facebook username, and proceeds to login to Drupal and create a user account via Services and the . On subsequent logins, these credentials are used for future logins.

Anyone interested in seeing the implementation: Trophy Life on Google Play

Technical specifications

Why these modules/theme/distribution were chosen: 

The key to pulling all of this together was the Services Module. Using the REST server included, the android app is able to query for lists of data in JSON format that can be formatted to the Android layout.

Geolocation was needed for proximity calculations, and display of node data onto Google maps.

Drupal for Facebook is a fantastic module that makes integration of the accounts with Facebook a breeze. Without it, I would have been lost for a long time.

The voting API works beautifully with Services to allow users to vote within the app on trophies, and then have the information sent to Drupal for voting.

I chose premium theme Tb Wall because it's a great looking theme that displays the trophies created in a "Pinterest" fashion that I always liked.

Another module not found on Drupal is the OpenGraphProtocol module for drupal 7 which allowed me to inject drupal content into the Facebook Open Protocol feed. OpenGraphProtocol was developed by Stéphane and he has a very good write up about it with regard to Drupal.

Team members: 
Sectors: 
Entertainment