Skip to content

Instantly share code, notes, and snippets.

@walterlua
Created September 21, 2012 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walterlua/3759412 to your computer and use it in GitHub Desktop.
Save walterlua/3759412 to your computer and use it in GitHub Desktop.
Corona and iOS custom url schemes test case
settings = {
iphone =
{
plist =
{
CFBundleIconFile = "Icon.png",
CFBundleIconFiles = {
"Icon.png",
"Icon@2x.png",
"Icon-72.png",
},
UIApplicationExitsOnSuspend = false, -- must be false for single sign-on to work
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
"haakon", -- replace XXXXXXXXX with your facebook appId
}
}
}
}
}
}
local count = 1
local textObject = display.newText( count .. ": Main.lua", 50, 240, 320, 0, native.systemFont, 12 )
textObject:setTextColor(255,0,0)
local function onSystemEvent( event )
count = count + 1
print( event.type, event.url )
local t = event.type
--on application OPEN state
if ( event.type == "applicationOpen" ) then
local suffix
if ( event.url ) then
suffix = event.url
else
suffix = "NO URL!"
end
t = t .. ' ' .. suffix
--on application START state
elseif ( event.type == "applicationStart" ) then
end
textObject.text = textObject.text .. '\n' .. count .. ': ' .. t
end
Runtime:addEventListener( "system", onSystemEvent )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment