Skip to content

Instantly share code, notes, and snippets.

@revmob-sdk
Created June 7, 2012 21:22
Show Gist options
  • Save revmob-sdk/2891607 to your computer and use it in GitHub Desktop.
Save revmob-sdk/2891607 to your computer and use it in GitHub Desktop.
RevMob Corona SDK
-- You may add this code in the main.lua file
require 'revmob'
local REVMOB_IDS = { ["Android"] = "Android App Id", ["iPhone OS"] = "IPhone OS App Id" }
RevMob.startSession(REVMOB_IDS)
local banner = RevMob.createBanner({x = display.contentWidth / 2, y = display.contentHeight - 20, width = 300, height = 40 })
-- You can also register listeners for Ad events:
revmobListener = function (event)
msg("Event: " .. event.type)
end
RevMob.startSession(REVMOB_IDS)
local banner = RevMob.createBanner({adListener = revmobListener })
Banner:release()
-- You may add this code in the main.lua file
require 'revmob'
local REVMOB_IDS = { ["Android"] = "Android App Id", ["iPhone OS"] = "IPhone OS App Id" }
RevMob.startSession(REVMOB_IDS)
RevMob.showFullscreen()
-- You can also register listeners for Ad events:
revmobListener = function (event)
msg("Event: " .. event.type)
end
RevMob.startSession(REVMOB_IDS)
RevMob.showFullscreen(revmobListener)
local PLACEMENT_IDS_FULLSCREEN_PHASE_1 = { ["Android"] = "Android Placement Id 1", ["iPhone OS"] = "IPhone OS Placement Id 1" }
local PLACEMENT_IDS_POPUP_PHASE_1 = { ["Android"] = "Android Placement Id 1", ["iPhone OS"] = "IPhone OS Placement Id 1" }
local PLACEMENT_IDS_FULLSCREEN_PHASE_2 = { ["Android"] = "Android Placement Id 2", ["iPhone OS"] = "IPhone OS Placement Id 2" }
RevMob.startSession(REVMOB_IDS)
RevMob.showFullscreen(revmobListener)
RevMob.showFullscreen(revmobListener, PLACEMENT_IDS_FULLSCREEN_PHASE_1)
RevMob.showPopup(revmobListener, PLACEMENT_IDS_POPUP_PHASE_1)
RevMob.showFullscreen(revmobListener, PLACEMENT_IDS_FULLSCREEN_PHASE_2)
-- You may add this code in the main.lua file
require 'revmob'
local REVMOB_IDS = { ["Android"] = "Android App Id", ["iPhone OS"] = "IPhone OS App Id" }
RevMob.startSession(REVMOB_IDS)
RevMob.showPopup()
-- You can also register listeners for Ad events:
revmobListener = function (event)
msg("Event: " .. event.type)
end
RevMob.startSession(REVMOB_IDS)
RevMob.showPopup(revmobListener)
-- You may add this code in the main.lua file
require 'revmob'
-- This method must be called before any other method of the RevMob SDK.
local REVMOB_IDS = { ["Android"] = "Android App Id", ["iPhone OS"] = "IPhone OS App Id" }
RevMob.startSession(REVMOB_IDS)
local REVMOB_IDS = { ["Android"] = "Android App Id", ["iPhone OS"] = "IPhone OS App Id" }
-- scenario of success: with ads
RevMob.startSession(REVMOB_IDS, RevMob.TEST_WITH_ADS)
-- scenario of failure: without ads
RevMob.startSession(REVMOB_IDS, RevMob.TEST_WITHOUT_ADS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment