I generally have a “settings” file which isn’t created until the app runs the first time. If that file doesn’t exist, then you know it’s a first run, or the app was deleted and re-installed in which case, you want to use your “first run” logic anyway.
You can also use the system.getPreference() and system.setPreferences() APIs to do the same thing. It might be a little less code to use these APIs: http://docs.coronalabs.com/api/library/system/getPreference.html
local hasAppRunBefore = system.getPreference( "app", "hasAppRunBefore", "boolean" ) if not hasAppRunBefore then system.setPreferences( "app", { hasAppRunBefore = true } ) -- do your first run logic here end
(untested code)
Rob