system.GetInfo() not working correctly ?

I am trying to determine if program is running on desktop and it seems system.getInfo(“platform”) returns nil on desktop instead of “macos”…

example from forum :

local isRunningOnDesktop = false

if (system.getInfo(“environment”) == “device”) then

    local platformName = system.getInfo(“platform”)   --(platformName Deprecated)

    if (platformName == “Win”) or (platformName == “macos”) then

        isRunningOnDesktop = true

    end

end

in this case platformName is nil

I can use nil as workaround but is anyone else seeing this or am I doing something wrong ?

Corona build 2016.3007

It seems to be returning “macos” for me when I run a desktop build.

Rob

Thanks Rob 

  It must be something else in my spaghetti code  :huh:

roger

I am getting a nil value for system.getInfo(“platform”) too. I am running on a Mac. It is supposed to return macos. But didn’t. However, supposedly deprecated method system.getInfo(“platformName”) still works. Am I missing something? Any help is greatly appreciated!

What version of Corona SDK are you using?

Rob

Hi Rob,

Thanks for responding. I am using version 10.10.5.

Rob,

Correction. Corona SDK is Build: 2015.2646.

Thanks.

I believe that API was added after that build. Our current public build is 2992 and our daily builds is up to 3016. If you’re using any plugins on Android, you should use 3007 or later.

Rob

Rob,

Thanks for the information. If I just install the dmg file of 3007, will there be any impact to my existing code?

Cheers,

aru_aak

Bob, Nevermind. Since I use outlaw, I pointed the SDK folder to the new folder and everything works fine including the API in question. Thanks a lot again!

It seems to be returning “macos” for me when I run a desktop build.

Rob

Thanks Rob 

  It must be something else in my spaghetti code  :huh:

roger

I am getting a nil value for system.getInfo(“platform”) too. I am running on a Mac. It is supposed to return macos. But didn’t. However, supposedly deprecated method system.getInfo(“platformName”) still works. Am I missing something? Any help is greatly appreciated!

What version of Corona SDK are you using?

Rob

Hi Rob,

Thanks for responding. I am using version 10.10.5.

Rob,

Correction. Corona SDK is Build: 2015.2646.

Thanks.

I believe that API was added after that build. Our current public build is 2992 and our daily builds is up to 3016. If you’re using any plugins on Android, you should use 3007 or later.

Rob

Rob,

Thanks for the information. If I just install the dmg file of 3007, will there be any impact to my existing code?

Cheers,

aru_aak

Bob, Nevermind. Since I use outlaw, I pointed the SDK folder to the new folder and everything works fine including the API in question. Thanks a lot again!