Skip to content

Instantly share code, notes, and snippets.

@thelazycamel
Last active August 29, 2015 14:06
Show Gist options
  • Save thelazycamel/5fad194df41941862017 to your computer and use it in GitHub Desktop.
Save thelazycamel/5fad194df41941862017 to your computer and use it in GitHub Desktop.
Ad Network for RubyMotion (using Leadbolt)
This is a walkthough on how to add an Advertising network into your RubyMotion Project, the AdNetwork I am using is leadbolt,
I have not used them long enough to give a full review, but so far they seem reputable and easy to use, with a web based dashboard for managing your apps and banners.
http://www.leadbolt.com/developers-signup/?ref=10083628 => This is a referral link, so would apprieciate if you used it :)
Sign up to leadbolt, Download their IOS sdk, add your app details, and follow the simple instructions on their site.
move downloaded files into:
/vendor/leadbolt/
I had to move the libAppTracker.a file up to the root of the /leadbolt directory
should look like this:
/vendor/leadbolt
> AppFireworks/
> LBHeaders/
> libAppTracker.a
> libLeadboltOverlay.a
in your rake file:
add the following:
app.frameworks += [“AudioToolBox”,”AVFoundation”,"AdSupport","SystemConfiguration","CoreMotion","StoreKit”]
app.vendor_project('vendor/leadbolt', :static)
Then in your controller add the following:
def viewDidLoad
super
leadbolt_tracking
display_leadbolt_adverts
end
def leadbolt_tracking
NSNotificationCenter.defaultCenter.addObserver(self, selector:"handle_module_fail", name:"OnModuleFailed", object:"AppFireworksNotification")
AppTracker.startSession(“AppFireworksAPIKey", view:self.view)
end
def handle_module_fail
display_leadbolt_adverts
end
def display_leadbolt_adverts
bottom_banner = LeadboltOverlay.createAdWithSectionid("SectionID", view:self.view)
bottom_banner.loadAd
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment