Created
September 21, 2012 02:17
-
-
Save walterlua/3759412 to your computer and use it in GitHub Desktop.
Corona and iOS custom url schemes test case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
settings = { | |
iphone = | |
{ | |
plist = | |
{ | |
CFBundleIconFile = "Icon.png", | |
CFBundleIconFiles = { | |
"Icon.png", | |
"[email protected]", | |
"Icon-72.png", | |
}, | |
UIApplicationExitsOnSuspend = false, -- must be false for single sign-on to work | |
CFBundleURLTypes = | |
{ | |
{ | |
CFBundleURLSchemes = | |
{ | |
"haakon", -- replace XXXXXXXXX with your facebook appId | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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