Configuration
Access the RevMob Console and register your application to get your RevMob App ID;
Download the latest version of the SDK;
Open the SDK directory and then drag and drop the directory RevMobAds.framework inside the file groups of your project on XCode. Also, do not forget to include the frameworks SystemConfiguration.framework, StoreKit.framework and AdSupport.framework that are not included by default. You can do that by clicking in the project root > Build Phases > Link Binary With Libraries > Click in the + button.

- To use the RevMobAds.framework, just import it (in .h or .m files) in every class you want to use it:
#import <RevMobAds/RevMobAds.h>
Start Session
Before showing any ads, you must start a RevMob session with your RevMob App ID.
- To start a RevMob session just call the
startSession:method in the beginning of theapplication:didFinishLaunchingWithOptions:of your AppDelegate.
#import <RevMobAds/RevMobAds.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[RevMobAds startSessionWithAppID:@"copy your RevMob App ID here"];
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[SampleAppViewController alloc] init] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
@end
Testing Mode
While you are developing your app, you will probably want to test two scenarios:
- When the RevMob show an advertisement successfully.
- When the RevMob does not deliver an advertisement because some internal rule.
Activating the testing mode you are allowed to reproduce these two scenarios easily. And you do not need to worry about statistics because the prints/clicks/installs are not counted.
Just be sure to disable/delete the testing mode before publishing your app to the store.
[RevMobAds session].testingMode = RevMobAdsTestingModeWithAds;
[RevMobAds session].testingMode = RevMobAdsTestingModeWithoutAds;
Fullscreen

Fullscreen is a ad unit with a high eCPM. You can show it in the beginning or in the end of a round, for example.
- In the implementation file (.m files) call the method showFullscreen. A good place to do this is in applicationDidBecomeActive method.
#import "AppDelegate.h"
#import <RevMobAds/RevMobAds.h>
@implementation AppDelegate
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[RevMobAds session] showFullscreen];
}
@end
- Below, you can see a video showing how to implement the fullscreen ad unit.
Banner

- In the implementation file (.m files) call the method showBanner. A good place to do this is in
applicationDidBecomeActivemethod.
#import "AppDelegate.h"
#import <RevMobAds/RevMobAds.h>
@implementation AppDelegate
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[RevMobAds session] showBanner];
}
@end
- To hide the banner.
[[RevMobAds session] hideBanner];
You can also change the size and locaiton of the banner, just follow this documentation.
Below, you can see a video showing how to implement the banner ad unit.
Link
Use the Link to redirect the user to the advertised mobile application download page. A common usage is to associate the link to a "more games" button or to a custom banner. Be sure you are using listeners to check if the link was loaded successfully, otherwise you create a workaround for this situation, like hide the button.
- Include the
RevMobAdsDelegateprotocol your your .h file:
#import <UIKit/UIKit.h>
#import <RevMobAds/RevMobAds.h>
@interface YourUIViewController : UIViewController <RevMobAdsDelegate>
@end
- In UIViewController implementation (.m files) call the method openAdLinkWithDelegate:.
#import "AppDelegate.h"
@implementation AppDelegate
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[RevMobAds session] openAdLinkWithDelegate:self];
}
@end
- Below, we have a video showing the ad link implementation.
Button
This ad unit is a button properly configured to offer more free apps to your users. In other words, it is a UIButton that uses the RevMob Ad Link internally. You can use the same strategy if you want a more customizable button.
In your UIViewController implementation (.m files) call the method button or one of its variations. A good place to do this is in the viewDidLoad method.
#import "SampleAppViewController.h"
@implementation SampleAppViewController
- (void)viewDidLoad {
[super viewDidLoad];
CGFloat width = floorf(self.view.frame.size.width*.8);
CGFloat height = 80;
CGFloat offset = floorf((self.view.frame.size.width*.8 - width)/2);
UIButton *button = [[RevMobAds session] button];
button.frame = CGrectMake(offset,offset,height,width);
[self.view addSubview:button];
// Optional title change
[button setTitle:@"More Free Games" forState:UIControlStateNormal];
// Optional color changes
UIImage *background1 = [self imageWithColor:[UIColor grayColor]];
UIImage *background2 = [self imageWithColor:[UIColor lightGrayColor]];
[button setBackgroundImage:background1 forState:UIControlStateNormal];
[button setBackgroundImage:background2 forState:UIControlStateSelected];
// Optional rounded corner changes, require #import <QuartzCore/QuartzCore.h>
button.layer.cornerRadius = 5;
button.clipsToBounds = YES;
}
@end
- Below, you can see a video showing the ad button implementation.
Popup

Popup is the simplest ad unit. We recommend it only for apps that will be intensively used by old devices with a slow internet connection. For all the other cases, we recommend you to use the fullscreen ad unit.
- In your Delegate or UIViewController implementation (.m files) call the method showPopup. A good place to do this is in applicationDidBecomeActive or viewDidLoad: method.
#import "AppDelegate.h"
#import <RevMobAds/RevMobAds.h>
@implementation AppDelegate
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[RevMobAds session] showPopup];
}
@end
- Below, there's a video showing the popup integration.
Listeners - Delegates
With Listeners (also known as Delegates or Callbacks) you can follow the ad workflow. The RevMob SDK will fire events for every important change in the ad state. For example, you can identify if the ad was loaded successfully or you can identify if the user clicked in the ad.
There are two way to get notifications about the ad, the recommended one is the use of completion blocks and the alternative is delegates. Both of them are available only through the use of objects not the facade, more info about the objects look at the API documentation. Here is a example of a fullscreen using completion blocks:
RevMobFullscreen *ad = [[RevMobAds session] fullscreen]; // you must retain this object
[ad loadWithSuccessHandler:^(RevMobFullscreen *fs) {
[fs showAd];
NSLog(@"Ad loaded");
} andLoadFailHandler:^(RevMobFullscreen *fs, NSError *error) {
NSLog(@"Ad error: %@",error);
} onClickHandler:^{
NSLog(@"Ad clicked");
} onCloseHandler:^{
NSLog(@"Ad closed");
}];
The alternative delegate method is:
RevMobFullscreen *ad = [[RevMobAds session] fullscreen]; // you must retain this object
ad.delegate = self;
[ad showAd];
- You can create a delegate for each ad unit request or you can create a shared delegate that will be used by many ad units.
To use a delegate you must implement the protocol
RevMobAdsDelegatein your AppDelegate or UIViewController.
#import <UIKit/UIKit.h>
#import <RevMobAds/RevMobAds.h>
@interface YourAppDelegate : UIResponder <UIApplicationDelegate, RevMobAdsDelegate>
@end
// or
@interface YourUIViewController : YourUIViewController <RevMobAdsDelegate>
@end
- In your AppDelegate or UIViewController implementation file, you must add the following methods:
– (void)revmobAdDidFailWithError:(NSError *)error {
NSLog(@"Ad failed with error: %@", error);
}
– (void)revmobAdDidReceive {
NSLog(@"Ad loaded successfullly");
}
– (void)revmobAdDisplayed {
NSLog(@"Ad displayed");
}
– (void)revmobUserClickedInTheAd {
NSLog(@"User clicked in the ad");
}
– (void)revmobUserClosedTheAd {
NSLog(@"User closed the ad");
}
Placement IDs
Placement ID is an optional feature recommended for experient publishers. If you want to enable/disable specific ad units in real time, or, if you want to have an exclusive tracking for an ad unit, you must use Placement IDs (do not confuse with App ID). First of all, you need to create one or more Placement IDs (for each ad unit) in the RevMob Console. Then copy the corresponding ID, and pass it through the ad method calls.
// Fullscreen example
RevMobFullscreen *fullscreen = [[RevMobAds session] fullscreenWithPlacementId:@"your placementId"];
[fullscreen showAd];
// methods for other ad units:
[[RevMobAds session] bannerViewWithPlacementId:@"your placementId"];
[[RevMobAds session] adLinkWithPlacementId:@"your placementId"];
[[RevMobAds session] buttonWithPlacementId:@"your placementId"];
[[RevMobAds session] popupWithPlacementId:@"your placementId"];
Timeout
You can change the connection timeout to the RevMob servers, if necessary.
[[RevMobAds session].connectionTimeout = 5; // 5 seconds
Higher eCPM Data-Targeted Ads
If you can, it would be a great idea to send some information in order to enable RevMob to serve better-targeted ads. This can increase your eCPM and revenue.
Example:
[RevMobAds session].userGender = RevMobUserGenderFemale;
[RevMobAds session].userInterests = @[@"games", @"mobile", @"advertising"];
[RevMobAds session].userPage = @"http://www.facebook.com/revmob";
[RevMobAds session].userAgeRangeMax = 21;
[RevMobAds session].userAgeRangeMin = 18;
[RevMobAds session].userBirthday = userBirthday;
If you integrate the Facebook SDK in your app you can use this code snippet to get this info.
Contact
If you are having any issue to integrate the RevMob SDK, send us a message clicking in the Contact Us link in the RevMob Web Site. To accelerate the response of our team, please, attach the console logs printed by the following command that print a summary of your environment configuration.
[[RevMobAds session] printEnvironmentInformation];








