iphoneversioncoronasdk

How to get iOS application version?


For my iOS application I need to access the application version number. In Objective-C and Xcode done by accessing Info.plist but I want this functionality in the Corona SDK.

Is this possible? If yes then how?


Solution

  • Build-time properties can be provided in an optional build.settings file, which uses Lua syntax. You can set and retrieve plist values via the sample shown here.

    settings =
    {
       orientation =
       {
           default = "portrait",
           supported =
           {
                "portrait", "portraitUpsideDown", "landscapeRight", "landscapeLeft"
         }
    },
    
    
    iphone =
    {
        plist =
        {
            UIInterfaceOrientation = "UIInterfaceOrientationLandscapeRight",
    
            UISupportedInterfaceOrientations =
            {
                "UIInterfaceOrientationLandscapeLeft",
                "UIInterfaceOrientationLandscapeRight"
            },
    
            UIApplicationExitsOnSuspend = true,
            UIStatusBarHidden = true,
            UIPrerenderedIcon = true
    
           }
        }
    }
    
    
    settings.iphone.plist["UIInterfaceOrientation~ipad"] = "UIInterfaceOrientationPortrait"
    settings.iphone.plist["UISupportedInterfaceOrientations~ipad"] = 
    {
        "UIInterfaceOrientationPortrait",
        "UIInterfaceOrientationPortraitUpsideDown"
    }