Release version numbers are now date based: YYYY.MM.DD
Changes in 2017.12.11
Updated system.* library (see System Library below)
Removed export options. Specifically, globals, colors, and system are now always exported.
Forced external.* load. Now, all external libs (excluding AutoLan) loaded into SSK.
More small changes …
System Library
SSK2 provides a number of handy (global) variables for quickly checking what system you are running on, what device you are running on, and now what OS you are targeting.
Actual Environment - You can tell what the actual OS is your running under right now. This works in the simulator, on device, on desktop builds, etc.
Target Environment - If you’re running in the simulator, these variables will reflect the skin target OS. If you’re on an actual device or desktop build, they reflect the current OS.
Actual Device Flags - These flags (while more accurate on physical devices) do their best to reflect the specific device you are running on.
Hopefully this example snippet will clarify the purpose and usage of these variables:
if( onSimulator ) then print("Running app on simulator.") elseif( onDevice ) then print("Running app on real device.") end if( targetiOS ) then print("This app is either running in a simulated iOS device or on a real one.") elseif( targetAndroid ) then print("This app is either running in a simulated Android device or on a real one.") end if( oniPhoneX ) then print( "Great... running on any iPhone X with that funky notch... better adjust for it." ) end
i use this code to test iPhone X with Corona SDK version 3183.
it work on Corona simulator,but not work on Xcode simulator(9.2) and real device(iPhone X)
it should show AD on height 390,but AD is top position on iPhone X
require "ssk2.loadSSK" \_G.ssk.init() print( "SSK VERSION: " .. ssk.getVersion() ) isSimulator = "simulator" == system.getInfo("environment") -- checking if we are in Corona Simulator is\_iPhoneX = false if string.find( system.getInfo("architectureInfo"), "iPhone10,3" ) or string.find( system.getInfo("architectureInfo"), "iPhone10,6" ) then is\_iPhoneX = true end if( ssk.system.oniPhoneX ) then is\_iPhoneX = true end if display.pixelWidth == 1125 and display.pixelHeight == 2436 then is\_iPhoneX = true end if( is\_iPhoneX ) then admob.show( "banner", {y=390} ) print("iphone x is ok") else admob.show( "banner", {y="top"} ) print("iphone x is false") end
Hi is that a question? If so I don’t understand what you’re asking.
Also I don’t understand the extraneous code’s purpose:
isSimulator = "simulator" == system.getInfo("environment") -- checking if we are in Corona Simulator is\_iPhoneX = false if string.find( system.getInfo("architectureInfo"), "iPhone10,3" ) or string.find( system.getInfo("architectureInfo"), "iPhone10,6" ) then is\_iPhoneX = true end if( ssk.system.oniPhoneX ) then is\_iPhoneX = true end if display.pixelWidth == 1125 and display.pixelHeight == 2436 then is\_iPhoneX = true end
If you’re using the latest SSK2, your code should be this simple:
-- Do ONCE and ONLY ONCE in main.lua require "ssk2.loadSSK" \_G.ssk.init() -- Later, in any file... -- if( \_G.oniPhoneX ) then admob.show( "banner", {y=390} ) print("iphone x is ok") else admob.show( "banner", {y="top"} ) print("iphone x is false") end
I have confirmed in build 3184, the SSK2 iPhone X detection does in fact appear NOT to be working in the xCode iPhoneX simulator.
I am investigating.
Please Note: I do NOT have an iPhoneX so testing on real devices is not possible for me. That said, when I get this resolved I’ll release the test so anyone can verify on their on iPhoneX
Well, I’ve discovered the source of the issue as far as the xCode simulator goes. It is NOT providing the right architecture info string so I can’t detect the system you’re simulating.
Interestingly, this answers the question, “Is the xCode simulator actually an emulator?” Answer, “No, it is not.” It is not emulating the hardware, thus we can’t detect it’s type. Any emulator worth its salt would report back the right architecture info.
PS - Yes, I noticed that the xCode simulated iPhone X screen area was wrong (not all filled in) which makes me wonder if the simulator is even simulating an iPhoneX or if there is an issue there too.
I am not a native English speaker, i will do my best to let you know what i mean.
Xcode simulator architectureInfo is x86_64 and width=960,height=1704.
I use this code and it is working on Xcode simulator with iPhone X
print(display.pixelWidth) print(display.pixelHeight) if (( system.getInfo("architectureInfo")=="x86\_64" ) and display.pixelWidth == 960 and display.pixelHeight == 1704) then is\_iPhoneX = true end
i use this code to test iPhone X with Corona SDK version 3183.
it work on Corona simulator,but not work on Xcode simulator(9.2) and real device(iPhone X)
it should show AD on height 390,but AD is top position on iPhone X
require "ssk2.loadSSK" \_G.ssk.init() print( "SSK VERSION: " .. ssk.getVersion() ) isSimulator = "simulator" == system.getInfo("environment") -- checking if we are in Corona Simulator is\_iPhoneX = false if string.find( system.getInfo("architectureInfo"), "iPhone10,3" ) or string.find( system.getInfo("architectureInfo"), "iPhone10,6" ) then is\_iPhoneX = true end if( ssk.system.oniPhoneX ) then is\_iPhoneX = true end if display.pixelWidth == 1125 and display.pixelHeight == 2436 then is\_iPhoneX = true end if( is\_iPhoneX ) then admob.show( "banner", {y=390} ) print("iphone x is ok") else admob.show( "banner", {y="top"} ) print("iphone x is false") end
Hi is that a question? If so I don’t understand what you’re asking.
Also I don’t understand the extraneous code’s purpose:
isSimulator = "simulator" == system.getInfo("environment") -- checking if we are in Corona Simulator is\_iPhoneX = false if string.find( system.getInfo("architectureInfo"), "iPhone10,3" ) or string.find( system.getInfo("architectureInfo"), "iPhone10,6" ) then is\_iPhoneX = true end if( ssk.system.oniPhoneX ) then is\_iPhoneX = true end if display.pixelWidth == 1125 and display.pixelHeight == 2436 then is\_iPhoneX = true end
If you’re using the latest SSK2, your code should be this simple:
-- Do ONCE and ONLY ONCE in main.lua require "ssk2.loadSSK" \_G.ssk.init() -- Later, in any file... -- if( \_G.oniPhoneX ) then admob.show( "banner", {y=390} ) print("iphone x is ok") else admob.show( "banner", {y="top"} ) print("iphone x is false") end
I have confirmed in build 3184, the SSK2 iPhone X detection does in fact appear NOT to be working in the xCode iPhoneX simulator.
I am investigating.
Please Note: I do NOT have an iPhoneX so testing on real devices is not possible for me. That said, when I get this resolved I’ll release the test so anyone can verify on their on iPhoneX
Well, I’ve discovered the source of the issue as far as the xCode simulator goes. It is NOT providing the right architecture info string so I can’t detect the system you’re simulating.
Interestingly, this answers the question, “Is the xCode simulator actually an emulator?” Answer, “No, it is not.” It is not emulating the hardware, thus we can’t detect it’s type. Any emulator worth its salt would report back the right architecture info.
PS - Yes, I noticed that the xCode simulated iPhone X screen area was wrong (not all filled in) which makes me wonder if the simulator is even simulating an iPhoneX or if there is an issue there too.
I am not a native English speaker, i will do my best to let you know what i mean.
Xcode simulator architectureInfo is x86_64 and width=960,height=1704.
I use this code and it is working on Xcode simulator with iPhone X
print(display.pixelWidth) print(display.pixelHeight) if (( system.getInfo("architectureInfo")=="x86\_64" ) and display.pixelWidth == 960 and display.pixelHeight == 1704) then is\_iPhoneX = true end