Permalink
Browse files

Added description and usage instrutions

  • Loading branch information...
1 parent 7922385 commit e70b6a47c82c1ac1a56a97dd50d5799671653b13 @GrahamRanson GrahamRanson committed Oct 26, 2012
Showing with 75 additions and 2 deletions.
  1. +75 −2 README.md
View
@@ -1,4 +1,77 @@
GGPromote
-=========
+============
-GGPromote makes it very easy to retrieve accurate information on yours, or your friends, apps and games in order to display them in your own as a way of cross promotion. GGPromote does not do any of the display as I decided to leave that up to you but it would be very easy. Sample apps and data can be seen here: http://www.glitchgames.co.uk/ggPromote/
+GGPromote makes it very easy to retrieve accurate information on yours, or your
+friends, apps and games in order to display them in your own as a way of cross
+promotion. GGPromote does not do any of the display as I decided to leave that
+up to you but it would be very easy.
+
+Sample apps and data can be seen here: http://www.glitchgames.co.uk/ggPromote/
+
+
+Basic Usage
+-------------------------
+
+##### Require the code
+```lua
+local GGPromote = require( "GGPromote" )
+```
+
+##### Create your promotion object
+```lua
+local promote = GGPromote:new( "http://www.glitchgames.co.uk/ggPromote/", "appData.json" )
+```
+
+##### Refresh the locally stored data from the web
+```lua
+local onComplete = function( isError )
+ if not isError then
+ print( "Apps loaded" )
+ end
+end
+
+promote:refresh( onComplete )
+```
+
+##### Get a specific app
+```lua
+local app = promote:getApp( 23 )
+print( app.name )
+```
+
+##### Get all apps
+```lua
+local apps = promote:getApps()
+for i = 1, #apps, 1 do
+ print( apps[ i ].name )
+end
+```
+
+##### Load an apps icon
+```lua
+local onIconDownload = function( image, filename )
+ image.x = display.contentCenterX
+ image.y = display.contentCenterY
+end
+
+promote:loadAppIcon( 1, "114", onIconDownload )
+```
+
+##### Get some urls from the app
+```lua
+local itunes = promote:getAppUrl( 1, "appStore" )
+local google = promote:getAppUrl( 1, "googlePlay" )
+local website = promote:getAppUrl( 1, "website" )
+```
+
+##### Destroy the promotion object
+```lua
+promote:destroy()
+promote = nil
+```
+
+Update History
+-------------------------
+
+##### 0.1
+Initial release

0 comments on commit e70b6a4

Please sign in to comment.