Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

SSK2 Updated: 2017.12.11 Released
Started by roaminggamer Dec 11 2017 10:54 AM

10 replies to this topic
release
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

ssk2PRO_carousel_image2.jpg

 
Links

General Notes

  • I skipped a few release notes. 
  • 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.
 
The updated docs are here: https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/system/
 
In short, you can determine all of these things:

  • 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


Edited by roaminggamer, 12 December 2017 - 09:56 AM.


[TOPIC: post.html]
#2

pcschoolleo

[GLOBAL: userInfoPane.html]
pcschoolleo
  • Enthusiast

  • 36 posts
  • Corona SDK

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


[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

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

Edited by roaminggamer, 22 December 2017 - 09:52 AM.


[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

If you're saying that the SSK2 iPhone X detection is NOT working  I'll check into it.


PS - Thanks for posting, but in the future, please take a little time to make the post a little more legible:

  • Capitalization and punctuation are important.
  • Line breaks between separate statements (I have a real issue with walls of text).
  • Formatted code.

This will help me a lot.  Thanks again.


Edited by roaminggamer, 22 December 2017 - 09:59 AM.


[TOPIC: post.html]
#5

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

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

 

This is the test code I'm running:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/12/iPhoneX.zip

 

Posted a thread for help from iPhoneX owners:

https://forums.coronalabs.com/topic/71311-got-an-iphone-x-got-a-minute-to-test-something/

 

PS - Ugh... updating xCode install.  Sigh...


Edited by roaminggamer, 22 December 2017 - 11:01 AM.


[TOPIC: post.html]
#6

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

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.

 

I'm now waiting for feedback from any takers on the iPhoneX hardware tests: https://forums.coronalabs.com/topic/71311-got-an-iphone-x-got-a-minute-to-test-something/

 

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.

 

This video will elaborate:

 

 

 

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.


Edited by roaminggamer, 22 December 2017 - 12:08 PM.


[TOPIC: post.html]
#7

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

Hey! @pcschoolleo

 

@dvboren - Reports this is working on iPhoneX (architecture 10,3 variant) in the other thread: https://forums.coronalabs.com/topic/71311-got-an-iphone-x-got-a-minute-to-test-something/

 

Please test my demo app (not yours):

 

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/12/iPhoneX.zip

 

on your iPhoneX (physical device) and report back. 

 

Thanks!


Edited by roaminggamer, 22 December 2017 - 12:46 PM.


[TOPIC: post.html]
#8

pcschoolleo

[GLOBAL: userInfoPane.html]
pcschoolleo
  • Enthusiast

  • 36 posts
  • Corona SDK

hi

Thanks for your help, it help me a lot.

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


[TOPIC: post.html]
#9

pcschoolleo

[GLOBAL: userInfoPane.html]
pcschoolleo
  • Enthusiast

  • 36 posts
  • Corona SDK

hi

I don't have a iPhoneX (physical device).

I upload my App to App Store and let someone who have a iPhone X to test

So i need to fix my code and upload App Store again.

Once App is sale on the App Store, i will let people test.

I would tell you know the result.

Thanks for your help again.



[TOPIC: post.html]
#10

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

 

hi

Thanks for your help, it help me a lot.

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

 

...

 

 

 

Ah, I see thanks.  I'll give that some thought.  My concern is the xCode simulator may not have the same dimensions on all Macs.



[TOPIC: post.html]
#11

pcschoolleo

[GLOBAL: userInfoPane.html]
pcschoolleo
  • Enthusiast

  • 36 posts
  • Corona SDK

maybe

my Mac is Macbook 12(2017)

Hope  it will help

 

And i guess that Mac use Intel CPU will show x86_64




[topic_controls]
[/topic_controls]