NewGenApps Blog posts

Integrating Flurry analytics and Appirater in Corona applications

Written by Anurag | Apr 11, 2013 6:30:00 PM

In the current highly competitive space of mobile applications, it is very important for you to make your app stand out and become viral. Apart from advertising and marketing of apps, you also need to understand who your target audience is, how users are using your app, and what their feedback is. Plus getting good ratings from your app users also helps in making them more visible.


A very good way of getting your app statistics is using Flurry Analytics. Flurry provides a very easy to integrate SDK which you can use in your app and keep track of downloads, flow by users and other metrics.


Another thing which is very important in driving the sales of your apps is user reviews. While users love apps, we have seen that they don’t bother about leaving a feedback for the app unless they have a particularly good or bad experience with the app (usually the latter). So its a good thing to keep reminding to users that if they like the app, they can give it a 5-star rating. Appirater is a very good open-source project which lets you do just that.


While both Flurry and Appirater give you the steps for integrating them in a native iOS or Android project, they don’t provide the steps you need to follow when developing the app in a cross-platform tool like Corona.


Here’s a small tutorial showing you how to use these tools in your Corona application.


  • Launch LuaGlider

  • Create a new project (tap on the “New Project” icon (top left))

  • Specify the project name, location and folder. Click Finish


Adding Flurry Analytics

Now in your main.lua file, do the following for integrating Flurry analytics

  1. local analytics = require "analytics"

  2. local application_key = "Your_Flurry_App_key_here"

  3. analytics.init( application_key )


Adding Appirater

To add Appirater, do the following

Import appirater.lua file in your project (get the file from here)

Add this to main.lua

  1. local appirater = require "appirater"

  2. local function onSystemEvent( event )   

  3.    if event.type == "applicationStart" then

  4.        appirater.appLaunched(true)

  5.    elseif event.type == "applicationResume"  then

  6.        appirater.appEnteredForeground(true)

  7.    elseif event.type == "applicationExit"  then

  8.    elseif event.type == "applicationSuspend" then

  9.        appirater.appWillResignActive()

  10.    end

  11. end


Add this line wherever you want the rating alert to be shown

  1. appirater.userDidSignificantEvent(true)


Make sure you specify your app name and app id in the appirater.lua file so the correct review URL is opened

  1. local appirater_App_ID = "your_app_id_provided_by_apple"

  2. local appirater_App_Name = "your_app_name_as_in_itunesconnect"