iOS Pull-Tab Ad

The pull-tab is a new and unique ad format which is exclusively available through the MobileFuse SDK. Pull-tab ads are interactive rich-media units which peek in from the left side of your app. Users can initially interact with the ad by smoothly dragging it from the edge of the screen, or by tapping it to enter into a full-screen interstitial style experience.

Prerequisites

Follow the initial integration guide:
Ensure that you have a Pull-Tab Ad Placement ID to use

Display a pull-tab ad in your app

Displaying a pull-tab ad is a two-step process. First you should create and load your MFPullTabAd unit, then when you’re ready, call the showAd method to display the ad.

  1. Create a pull-tab ad unit

  2. Display the ad

Create an pull-tab ad unit

The MFPullTabAd class provided by the MobileFuse SDK will handle the loading, display, and interactivity of the pull-tab creative.

Note: Ensure that critical sections of your app, for example buttons or text, do not sit within the left margin of the screen when displaying a pull-tab ad.

First, create a new MFPullTabAd unit and keep a reference to it. We’ll also pass in our current view as this will be used as the pull-tab ad’s parent container.

MFPullTabAd *pullTabAd; - (void)createPullTabAd { pullTabAd = [[MFPullTabAd alloc] initWithPlacementId:@"000000"]; // Optionally register ourselves as a callback receiver (if we've implemented IMFAdCallbackReceiver) [pullTabAd registerAdCallbackReceiver:self]; [pullTabAd loadAd:self.view]; }

Note: Ensure that the SDK has fully initialized before creating your ad units. You can use the onInitSuccess callback as a good place to set up your ad units.

Registering a callback receiver will allow you to handle events generated by the pull-tab ad:

[pullTabAd registerAdCallbackReceiver:self]; // ... - (void)onAdLoaded:(MFAd *)ad { // The ad has loaded - you are able to show the ad once this callback has triggered } - (void)onAdNotFilled:(MFAd *)ad { // There is no ad currently available to show to this user } - (void)onAdClosed:(MFAd *)ad { // The ad has been displayed and then closed } - (void)onAdRendered:(MFAd *)ad { // Triggered when the ad is first shown to the user - you could use this to ensure that the left 10% of screen space doesn't contain controls that may be hidden by the pull-tab. } - (void)onAdPulled:(MFAd *)ad { // The ad has been pulled and expanded into full screen - will only be triggered for pull-tab ad } - (void)onAdClicked:(MFAd *)ad { // The user has clicked the ad } - (void)onAdExpired:(MFAd *)ad { // The ad has expired before being displayed - you should manually try to load a new ad here } - (void)onAdError:(MFAd *)ad withMessage:(NSString *)message { // An error occured - the message argument will contain details of what went wrong }

Display the ad

Once the pull-tab ad has triggered the onAdLoaded callback, you can then call showAd to start displaying the initial ‘peeking’ state of the ad:

Note: The pull-tab will render a tab in the left 10% of screen space. Be sure that when a pull-tab ad is displayed that you don’t place important UI components or buttons within this area. You may want to add padding to the left side of your activity to shift your UI away from the ad slightly.

[pullTabAd showAd];

You can also use isLoaded to check whether the ad is ready to be displayed.