Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Detect if the app is running in CoronaCards or "regular" Corona
Started by remyb Feb 16 2018 09:25 PM

2 replies to this topic
detection coronacards ios

Best Answer Rob Miracle , 17 February 2018 - 08:09 AM

This is kind of a hackish way, but if you use two different build numbers of Corona. Say CoronaCards 2018.3221 and the Corona Simulator 2018.3222 you could then use system.getInfo("build") https://docs.coronalabs.com/api/library/system/getInfo.html#build to get the version of Corona you're running and branch your code based on that.

 

Rob 

[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

remyb

[GLOBAL: userInfoPane.html]
remyb
  • Observer

  • 9 posts
  • Corona SDK

Hello,

 

We are developing a game that will be executed on Corona Cards, with a bunch of interactions with the native app (thanks to the Events).

 

However, it's really easier to develop without Corona Cards, with the Corona live builds.

 

Is there a way to detect if the game is running on Corona Cards or not, in order to "mock" some events that would come from the native app, during our development?

 

Thanks.



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

  Best Answer

This is kind of a hackish way, but if you use two different build numbers of Corona. Say CoronaCards 2018.3221 and the Corona Simulator 2018.3222 you could then use system.getInfo("build") https://docs.coronalabs.com/api/library/system/getInfo.html#build to get the version of Corona you're running and branch your code based on that.

 

Rob 



[TOPIC: post.html]
#3

remyb

[GLOBAL: userInfoPane.html]
remyb
  • Observer

  • 9 posts
  • Corona SDK

That'll do the trick, thank you.




[topic_controls]
[/topic_controls]