Adding an Offer Wall to Your iOS App

Summary

This article guides you through the process of displaying the Fyber Offer Wall ad format to users in your app. Before following this, you should have already completed: Quick Start: Integrating the Fyber Ad Monetization Platform

Please make sure that you are following the App Store <a href=”https://developer.apple.com/app-store/review/guidelines/” target=”blank”>guidelines</a>, especially <a href=”https://developer.apple.com/app-store/review/guidelines/#metadata” target=”blank”>clause 3.10</a>.

Configuring the Offer Wall

The following keys can be added to your applicaiton’s Info.plist in order to configure the Offer Wall

Key Type Example Description
FYBOFWShowCloseOnLoad Boolean YES If set to YES a close button will be displayed while the Offer Wall is loading
FYBOFWRequestTimeout Number 10 Define the time interval afer which the Offer Wall will be dismissed if it is not fully loaded

Displaying the Offer Wall

  1. Make sure the FyberSDK.h file is included, for example by adding the following statement at the beginning of the file you’re working with:
#import "FyberSDK.h"
  1. Make sure you’ve initialized the SDK previously as described in the Getting started with Fyber SDK document.
  2. Use the following code snippet to display the Offer Wall:
// Create an instance of the FYBOfferWallViewController
FYBOfferWallViewController *offerWallViewController = [FyberSDK offerWallViewController];

// Show the Offer Wall
[offerWallViewController presentFromViewController:parentViewController animated:YES completion:^{
  // Code executed when the Offer Wall is presented
} dismiss:^(NSError *error) {
  // Code executed when the Offer Wall is dismissed
  // If an error occurred, the error parameter describes the error otherwise this value is nil
}];

Controlling the Offer Wall

If you want to control the Offer Wall behavior after the user clicks on an offer, you can use the boolean property shouldDismissOnRedirect on the Offer Wall view controller FYBOfferWallViewController. If set to NO, the Offer Wall will remain open after the user is redirected to an offer. Otherwise, the Offer Wall will be automatically dismissed. Here is an example of how to use this property:

// Create an instance of the FYBOfferWallViewController
FYBOfferWallViewController *offerWallViewController = [FyberSDK offerWallViewController];

offerWallViewController.shouldDismissOnRedirect = NO;

// Show the Offer Wall
[offerWallViewController presentFromViewController:self animated:YES completion:^{
  // Code executed when the Offer Wall is presented
} dismiss:^(NSError *error) {
    // Code executed when the Offer Wall is dismissed
}];

Custom Parameters

You can pass along custom parameters (e.g. pub0, pub1, …) with the request by using the FYBRequestParameters object as follows

FYBOfferWallViewController *offerWallViewController = [FyberSDK offerWallViewController];

// Add the custom parameters
FYBRequestParameters *parameters = [[FYBRequestParameters alloc] init];
[parameters addCustomParameters:@{@"pub0": @"value"}];


// Show the Offer Wall
[offerWallViewController presentFromViewController:self parameters:parameters animated:YES completion:^{
    // Code executed when the Offer Wall is presented
    NSLog(@"Offer Wall presented");
} dismiss:^(NSError *error) {
    // Code executed when the Offer Wall is dismissed
}];