My app wants to check if the iOS version is 9 or above, how to do this checking?
I see some possible solution is to use “platformVersion” in system.getInfo() but I cannot find further explanation about it.
Please help me.
My app wants to check if the iOS version is 9 or above, how to do this checking?
I see some possible solution is to use “platformVersion” in system.getInfo() but I cannot find further explanation about it.
Please help me.
Use system.getInfo()
https://docs.coronalabs.com/daily/api/library/system/getInfo.html#platformversion
Run it on your device and see what you get. It should be fairly straight forward.
You can also look up charts on all devices to see what they’ll print out regarding other details.
-Ed
The code you want will look something like this:
local platformVersion = system.getInfo( "platformVersion" ) or 0 local majorVersion = tonumber(string.sub( platformVersion, 1, 1 )) if( majorVersion \>= 9 ) then print( "ios 9+" ) end
Use system.getInfo()
https://docs.coronalabs.com/daily/api/library/system/getInfo.html#platformversion
Run it on your device and see what you get. It should be fairly straight forward.
You can also look up charts on all devices to see what they’ll print out regarding other details.
-Ed
The code you want will look something like this:
local platformVersion = system.getInfo( "platformVersion" ) or 0 local majorVersion = tonumber(string.sub( platformVersion, 1, 1 )) if( majorVersion \>= 9 ) then print( "ios 9+" ) end