Version 8.1.0
The Chartboost iOS SDK is the cornerstone of the Chartboost network. It provides the functionality for showing interstitial, rewarded and banner ads.
- Before you begin:
- Have you signed up for a Chartboost account?
- Did you add an app to your dashboard?
- Did you download the latest SDK?
- Do you have an active publishing campaign?
- Note only iOS 9.0 or higher is supported.
-
Link the Chartboost.framework to your project, or use CocoaPods to manage the framework dependency for you.
-
Link the
StoreKitandWebKitframeworks. -
Add value "-ObjC" in "Other Linker Flags" for both Debug and Release.
-
Add the import header
#import <Chartboost/Chartboost.h>to your AppDelegate.m file. -
Initialize Chartboost in your
didFinishLaunchingWithOptionsmethod.
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Initialize the Chartboost library
[Chartboost startWithAppId:@"YOUR_CHARTBOOST_APP_ID"
appSignature:@"YOUR_CHARTBOOST_APP_SIGNATURE"
completion:^(BOOL initialized) {
NSLog(@"Chartboost SDK initialization finished with success %i", initialized);
}];
return YES;
}
Please note:
startWithAppId:appSignature:completion:must always be called on bootup, no matter what other actions your app takes.
-
Add your app ID and app signature.
- Replace
YOUR_CHARTBOOST_APP_IDandYOUR_CHARTBOOST_APP_SIGNATUREwith your app ID and app signature. - Where can I find my app ID and app signature?
- Replace
-
Learn how to load and show ads with Chartboost SDK.
- Check out our Example app (more info below).
- Read the headers included in the Chartboost framework. They contain detailed explanations and code examples. See
Chartboost.h,CHBInterstitial.h,CHBRewarded.h,CHBBanner.handCHBAdDelegate.h. - Check our online documentation to learn more.
-
Test your integration.
- Build and run your project from Xcode on a device or Simulator.
- [If you have an active publishing campaign and have integrated "show interstitial" or "show rewarded video" calls, you should see live ads.] (https://answers.chartboost.com/hc/en-us/articles/204930539)
- If you don't have any publishing campaigns and you've still integrated these calls, you can use Test Mode to see if test ads show up.
- Why can't I see ads in my game?
-
Check the SDK icon in the Chartboost dashboard.
- Go to your app's App Settings > Basic Settings in your dashboard.
- When our servers successfully receive a bootup call from our SDK using your app ID, the SDK icon underneath your app’s icon will turn from gray to green.
Our example app showcases how to integrate the Chartboost SDK.
## Versions
The master branch includes the example app supporting the latest version of the Chartboost SDK.
For previous SDK versions check out the other branches.
## Targets
The ChartboostExample project includes two targets:
ChartboostExample: Manual dependency management.
It requires the Chartboost.framework, which is already in the root directory (where this readme is) and linked to the Xcode project.
You can download the latest version of the Chartboost SDK here.
ChartboostExample-Pods: CocoaPods dependency management.
Just go into the project directory and run pod install.