I’ve just finished uploading to apple and now im on to google. Google is telling me to install a license key beacuse i plan to charge for the app. now im not a programmer, i used kwik to build my app. what im wondering is should i just copy and paste it into the .lua files or is there another way to do it.
The license key goes in your config.lua, sort of like this:
local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { graphicsCompatibility = 1, width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, license = { google = { key = "Really long string that you get from google goes here", policy = "serverManaged", }, }, }
That should be all you need to meet Google’s requirements. However, there are additional checks you can put in your main.lua to make sure your app is running with the license code verified. See this tutorial:
http://www.develephant.net/using-google-licensing-to-protect-your-corona-sdk-app/
That is perfect, thanks a bunch for the help, that was my last road block.
This is what i have so far but for some reason but for some reason i keep getting this response: unexpected symbol near ‘=’
its probably my fault, im not really a programmer.
local kScale = “zoomStretch”
if ( string.sub( system.getInfo(“model”), 1, 4 ) == “iPad” and display.pixelHeight == 1024) then – all iPads checking
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
imageSuffix = {
["@2"] = .5,
}
},
},
license =
{
google =
{
key = “MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhl5xvyiEE7DUAmVRAYWxchr2XL9t3IWYJ7qPgLyraG61Iozq1qY6uoXV5NwH1pKB0QDNmyYgU3rTtr4jD+waoXslg3AhHIV7xypmk4UPGEsf8XMpCi3zQgJLtDj263hHAILObDZ2c/vwxF7pa0Ip66/w6KBQLyXwMI/wbpxA/7Yn2AiEQ0tWwiicfdkBBoYClyyyAKzxiV5imZRUzlKnGGfWBvs2hOmBIrfZnvhYCZif/7+9XAP+WNMr2ZHrKZS34OzXgPmqZiTM/j1t4aiBYXXNRct2Kd+pVeTBruAG6vyNV7Tc/TqdU7VugeQIsTa5/oL2gMbkznze4gPKaHLv3wIDAQAB”,
policy = “serverManaged”,
},
},
}
}
elseif ( display.pixelHeight > 1024 ) then – iPhone 5 (and all other high-res devices) checking - uses the New iPad Retina image
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
},
}
else – all other devices
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
imageSuffix = {
["@2"] = .4,
}
},
}
end
Is this:
key =
“MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhl5xvyiEE7DUAmVRAYWxchr2XL9t3IWYJ7qPgLyraG61Iozq1qY6uoXV5NwH1pKB0QDNmyYgU3rTtr4jD+waoXslg3AhHIV7xypmk4UPGEsf8XMpCi3zQgJLtDj263hHAILObDZ2c/vwxF7pa0Ip66/w6KBQLyXwMI/wbpxA/7Yn2AiEQ0tWwiicfdkBBoYClyyyAKzxiV5imZRUzlKnGGfWBvs2hOmBIrfZnvhYCZif/7+9XAP+WNMr2ZHrKZS34OzXgPmqZiTM/j1t4aiBYXXNRct2Kd+pVeTBruAG6vyNV7Tc/TqdU7VugeQIsTa5/oL2gMbkznze4gPKaHLv3wIDAQAB”,
one line or did you break it apart on multiple lines? It should just be one really long line.
its just one really long line
What line number is the error on (I’m assuming it’s config.lua, but you might want to double check it’s not in another file) and what line of code is before and after it?
Rob
so its saying: Corona simulator syntax error line 17, unexpected symbol near ‘}’
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
imageSuffix = {
["@2"] = .5,
}
},
}
}, <<<<<<<<<<<<<<< THIS IS LINE 17
license =
{
google =
{
key = “MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhl5xvyiEE7DUAmVRAYWxchr2XL9t3IWYJ7qPgLyraG61Iozq1qY6uoXV5NwH1pKB0QDNmyYgU3rTtr4jD+waoXslg3AhHIV7xypmk4UPGEsf8XMpCi3zQgJLtDj263hHAILObDZ2c/vwxF7pa0Ip66/w6KBQLyXwMI/wbpxA/7Yn2AiEQ0tWwiicfdkBBoYClyyyAKzxiV5imZRUzlKnGGfWBvs2hOmBIrfZnvhYCZif/7+9XAP+WNMr2ZHrKZS34OzXgPmqZiTM/j1t4aiBYXXNRct2Kd+pVeTBruAG6vyNV7Tc/TqdU7VugeQIsTa5/oL2gMbkznze4gPKaHLv3wIDAQAB”,
policy = “serverManaged”,
},
},
}
aaronjoterry,
I highly recommend using the <code> option to better format your code on here. Makes it easier to read (even though it will cut off long lines… grrr…).
But looking at your code, from what I can tell, you have two many closing brackets there. If you look at line 17, that is the fourth closing bracket, yet there are only two opening brackets before it. Now, technically, you are missing in your code chunk that you provided, the
application = {
lines, but even with that, that would only be three opening brackets.
So I think the fix is to delete line 16. That should even things out. Though you might want to verify that while looking at your complete code block.
ok so i’ve deleted line 16 and now its telling me unexpected symbol near ‘=’
Then please post the entire content of the file, along with the complete error message including line number.
Corona simulator syntax error
config.lua line 17 unexpected symbol near ‘=’
Corona version-2013-1.1202 (the version of kwik i’m using requires this version of corona)
local kScale = “zoomStretch”
if ( string.sub( system.getInfo(“model”), 1, 4 ) == “iPad” and display.pixelHeight == 1024) then – all iPads checking
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
imageSuffix = {
["@2"] = .5,
}
},
},
license =
{
google =
{
key = “MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhl5xvyiEE7DUAmVRAYWxchr2XL9t3IWYJ7qPgLyraG61Iozq1qY6uoXV5NwH1pKB0QDNmyYgU3rTtr4jD+waoXslg3AhHIV7xypmk4UPGEsf8XMpCi3zQgJLtDj263hHAILObDZ2c/vwxF7pa0Ip66/w6KBQLyXwMI/wbpxA/7Yn2AiEQ0tWwiicfdkBBoYClyyyAKzxiV5imZRUzlKnGGfWBvs2hOmBIrfZnvhYCZif/7+9XAP+WNMr2ZHrKZS34OzXgPmqZiTM/j1t4aiBYXXNRct2Kd+pVeTBruAG6vyNV7Tc/TqdU7VugeQIsTa5/oL2gMbkznze4gPKaHLv3wIDAQAB”,
policy = “serverManaged”,
},
},
}
elseif ( display.pixelHeight > 1024 ) then – iPhone 5 (and all other high-res devices) checking - uses the New iPad Retina image
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
},
}
else – all other devices
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
imageSuffix = {
["@2"] = .4,
}
},
}
end
You still have too many brackets there.
The first closing bracket closes the imageSuffix node. The second closing bracket closes the content node. The third closing bracket closes the application node. Which should not be happening. Because the next part of the code – the license node – needs to be inside the application node.
Fairly certain that if you get rid of that third closing bracket, it will work. The brackets then all line up correctly from what I can see.
(And I know that in Lua, those actually aren’t called nodes. My apologies for being confusing. I’m more of a web developer and still wrapping my head around all the terms for Lua code and programming.)
Alright it worked, thanks for taking the time to help me. Still new to this whole programming thing.
Phew, glad that did it.
I think you will find that people on here can be very helpful if you provide them the information they need to help you figure it out. Good luck on continuing on the project!
The license key goes in your config.lua, sort of like this:
local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { graphicsCompatibility = 1, width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, license = { google = { key = "Really long string that you get from google goes here", policy = "serverManaged", }, }, }
That should be all you need to meet Google’s requirements. However, there are additional checks you can put in your main.lua to make sure your app is running with the license code verified. See this tutorial:
http://www.develephant.net/using-google-licensing-to-protect-your-corona-sdk-app/
That is perfect, thanks a bunch for the help, that was my last road block.
This is what i have so far but for some reason but for some reason i keep getting this response: unexpected symbol near ‘=’
its probably my fault, im not really a programmer.
local kScale = “zoomStretch”
if ( string.sub( system.getInfo(“model”), 1, 4 ) == “iPad” and display.pixelHeight == 1024) then – all iPads checking
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
imageSuffix = {
["@2"] = .5,
}
},
},
license =
{
google =
{
key = “MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhl5xvyiEE7DUAmVRAYWxchr2XL9t3IWYJ7qPgLyraG61Iozq1qY6uoXV5NwH1pKB0QDNmyYgU3rTtr4jD+waoXslg3AhHIV7xypmk4UPGEsf8XMpCi3zQgJLtDj263hHAILObDZ2c/vwxF7pa0Ip66/w6KBQLyXwMI/wbpxA/7Yn2AiEQ0tWwiicfdkBBoYClyyyAKzxiV5imZRUzlKnGGfWBvs2hOmBIrfZnvhYCZif/7+9XAP+WNMr2ZHrKZS34OzXgPmqZiTM/j1t4aiBYXXNRct2Kd+pVeTBruAG6vyNV7Tc/TqdU7VugeQIsTa5/oL2gMbkznze4gPKaHLv3wIDAQAB”,
policy = “serverManaged”,
},
},
}
}
elseif ( display.pixelHeight > 1024 ) then – iPhone 5 (and all other high-res devices) checking - uses the New iPad Retina image
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
},
}
else – all other devices
application =
{
content =
{
graphicsCompatibility = 1, — This turns on V1 Compatibility mode
width = 1536,
height = 2048,
fps = 60,
scale = kScale,
imageSuffix = {
["@2"] = .4,
}
},
}
end
Is this:
key =
“MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhl5xvyiEE7DUAmVRAYWxchr2XL9t3IWYJ7qPgLyraG61Iozq1qY6uoXV5NwH1pKB0QDNmyYgU3rTtr4jD+waoXslg3AhHIV7xypmk4UPGEsf8XMpCi3zQgJLtDj263hHAILObDZ2c/vwxF7pa0Ip66/w6KBQLyXwMI/wbpxA/7Yn2AiEQ0tWwiicfdkBBoYClyyyAKzxiV5imZRUzlKnGGfWBvs2hOmBIrfZnvhYCZif/7+9XAP+WNMr2ZHrKZS34OzXgPmqZiTM/j1t4aiBYXXNRct2Kd+pVeTBruAG6vyNV7Tc/TqdU7VugeQIsTa5/oL2gMbkznze4gPKaHLv3wIDAQAB”,
one line or did you break it apart on multiple lines? It should just be one really long line.