Rich Media (MRAID 2.0) Support

Document created by david.simerly on Oct 20, 2017Last modified by david.simerly on Apr 3, 2018
Version 19Show Document
  • View in full screen mode

PubMatic SDKs 

PubMatic iOS SDK 

Getting Started

Integrating Banner Ads

Integrating Interstitial Ads

➤  Rich Media (MRAID 2.0) Support

Integrating Native Ads

Header Bidding With DFP

Passing Targeting Information

SDK Debugging


PubMatic iOS SDK Reference 

Rich Media Ads are designed to work with HTML 5 and JavaScript to deliver features such as dynamic sizing and access to mobile device features like the accelerometer.

Today creative developers use a variety of different SDKs from many rich media vendors, each with its own set of APIs and integration requirements. This means rich media developers must often build different versions of the same creative in order to deploy across different apps. Developing a single API that SDK vendors can support is the goal of developing a rich media standard.

 

You'll need to follow the instructions in Getting Started before proceeding with the following integration steps. You'll also find a useful example integration in SampleApp included in the SDK download bundle.

             

 

Once you've downloaded and installed the PubMatic iOS SDK, use the following sections to use the SDK to add MRAID support to your app:

 

 

About MRAID

MRAID is the IAB Mobile Marketing Center Of Excellence’s project to define a common API for creating mobile, Rich Media ads that run in mobile apps. The objective of MRAID is to simplify Rich Media ad deployment by creating an open standard and set of industry best practices to which leading publishers, developers, and vendors can contribute and adopt.

 

Display Rich Media Ad

Once you've performed a successful integration with Banner or Interstitial ads, you can easily support MRAID ads by implementing the following delegate methods that let Rich Media ads access mobile device functionality to enhance the user's interaction with the ads.

 

Here is an example delegate implementation for PMBannerAdView:

 

// If not implemented, SDK assumes NO as default value
- (BOOL)bannerAdViewSupportsCalendar:(PMBannerAdView *)adView
{
    return YES;
}
// If not implemented, SDK assumes NO as default value
-(BOOL)bannerAdView:(PMBannerAdView *)adView shouldSaveCalendarEvent:(EKEvent *)event inEventStore:(EKEventStore *)eventStore
{
    return YES;
}
// If not implemented, SDK assumes NO as default value
- (BOOL)bannerAdViewSupportsStorePicture:(PMBannerAdView*)adView{
    return  YES;
}
// If not implemented, SDK assumes NO as default value
-(BOOL)bannerAdView:(PMBannerAdView *)adView shouldSavePhotoToCameraRoll:(UIImage *)image
{
    return YES;
}
// If not implemented, SDK assumes YES as default value
- (BOOL)bannerAdView:(PMBannerAdView*)adView shouldPlayVideo:(NSString*)videoUR{

    return YES;
}
// If not implemented, SDK derives this from device's capability
- (BOOL)bannerAdViewSupportsSMS:(PMBannerAdView*)adView{
    return YES;
}
// If not implemented, SDK derives this from device's capability
- (BOOL)bannerAdViewSupportsPhone:(PMBannerAdView*)adView{
    return YES;
}

 

To display Rich Media ads as interstitial, there are similar delegate methods in PMInterstitialAdDelegate.

 

Supporting MRAID Features That Require User Authorization

MRAID features that require user authorization include:

 

  • Save pictures to a device's photo library.
  • Create a new event in a device's calendar.

 

For MRAID to access these features, you must include respective usage keys in your app’s Info.plist file. Each key must also include a purpose string. Also, to protect user privacy, any iOS app linked on or after iOS 10, which accesses either of these features, must statically declare the intent to do so.

See Using Description Keys for details.

 

Attachments

    Outcomes