audience-bidding | Audience Bidding for DFP (iOS)

Prerequisites

  • The following environments are required:
    • iOS 9+
    • XCode 11

Step 1: Integrating the SDK

Step 1.1: Download the InMobi SDK

a. Download the latest InMobi SDK below. We also provide the option to use CocoaPods! Download the InMobi iOS SDK here.

The SDK bundle contains all media adapters that we support. Prune the downloaded folder to retain the media adapters you need.

b. CocoaPods (Recommended)

In the same directory as your YOUR_PROJECT.xcodeproj, create an empty file named Podfile and copy and paste the following:

platform :ios, '9.0'
target 'APP_NAME' do
      pod ‘InMobiABAdMobDFPPlugin’
end
	

Ensure your project has been closed. Using the terminal, navigate to the directory containing the Podfile and run the command: pod install. Once the installation finishes, use YOUR_PROJECT.xcworkspace to access your project moving forward.

Inside the xcworkspace there should be a Pods directory included with a ios-sdk-pod sub-directory.

Warning: Please remove all older versions of the InMobi SDK (8.X.X and older) and all older versions of the AerServ SDK. Otherwise, your code will not compile! Please reach out to your account manager if you have any questions. If you are using CocoaPods, be sure to remove the 'aerserv-ios-sdk' pod from your podfile and only use the 'inmobi-ios-sdk' pod.

  • Step 1.2: Add the Required Libraries

    Add the following frameworks into your project from the InMobi SDK download:

    • InMobiSDK.framework

Note: When using any mediation through the InMobi SDK, it is highly recommended that you use the framework that is provided along with the InMobi SDK download. These versions have been tested by our team and using any other version may not be officially supported.

  • Step 1.3: General Settings

Under the General tab within your project's target, you'll need to add the following settings:

  • Add the following dependencies to Linked Frameworks and Libraries:
    • WebKit.framework
    • ibxml2..tbd
    • libz.tbd
    • libsqlite.3.0.tbd

One or more of the mediation adapters that you selected requires these frameworks. For the SDKs to work properly, you MUST include these frameworks in your project.

  • Step 1.4: Create a bridging header (Swift Only)

You will need to create a bridging header if your application is built with Swift. The bridging header exposes the Objective-C implementation to Swift. To create the bridging header, you'll need to do the following:

  1. Create a new header file, InMobiSDK-Bridging-Header.h.
  2. Add the following entry to the Bridging Header:
    #import <InMobiSDK/InMobiSDK.h>
    		
  3. Add the newly created header file's path to the target's Build Setting -> Linking -> Objective-C Bridging Header
  • Step 1.5: Build Settings

Add the following flags to the target's Build Setting -> Linking -> Other Linker Flag:

-ObjC

  • Step 1.6: Info.plist

You will need to add the following entries into your info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is used to help target content to your general area</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Some ad content may require access to the photo library.</string>
<key>NSCameraUsageDescription</key>
<string>Some ad content may access camera to take picture.</string>
	

Step 1.7.1 Audience Bidding

To use the InMobi Audience Bidding SDK, here is how you can expect the flow to go:

  1. The InMobi Audience Bidder SDK will make an ad request and return a bid object
  2. The bid object from InMobi Audience Bidder will have an updated DFPRequest Object and have pricing keywords attached
  3. You then call loadRequest() with the DFPRequest object as before
  4. If InMobi is selected to fill, The InMobi Audience Bidder SDK will handle the rendering

Note: Contact your account manager for Audience Bidding placement setup.

Optionally, if you would like to handle the keywords yourself, you may also observe the below flow:

  1. The InMobi Audience Bidder SDK will make an ad request.
  2. The response from InMobi Audience Bidder will have an IMABBidResponse object
  3. You may query the object for the bid keyword, price, granular keyword, InMobi placement, and buyer.
  4. You would then append the bid keyword in customTargeting and set placement id with GADCustomEventExtras using IMABCustomEvent key to DFPRequest object.
  5. You would then call loadRequest() with the DFPRequest object as before
  6. If InMobi is selected to fill, The InMobi Audience Bidder SDK will handle the rendering

Step 1.7.1.1 Audience Bidding Setup on DFP

To enable Audience Bidding, you will need to do 2 things:

  1. Set up the yield group to use the specific keywords with pricing used by the IMAudienceBidder class.
  2. Update your existing DFP integration details.

Step 1.7.1.1.1 Setting up the DFP Yield Groups
  1. Sign in to Google Ad Manager.
  2. Click Delivery > Yield groups.
  3. Click New yield group. Enter a unique yield group Name that's descriptive for reporting.
  4. Select the Ad format and Inventory type you wish to target with this yield group.
  5. Define Key values using the keyword: “IMAB” for different price points. Enter the keyword in the following format IMAB:0.00 (eg. IMAB:0.50)
  6. Then add/map the ad units to these keywords under Custom Targeting.

  7. Ad Exchange will be your default partner/demand source on the UI. Proceed to add additional third-party yield partner and select InMobi (as the ad network) to compete for the targeted inventory.

    Note: Please ensure that the CustomClass name is as follows for Banner and Interstitial

    • Banner: IMABCustomEventBanner
    • Interstitial: IMABCustomEventInterstitial

    Note: Label should be mentioned as: IMABCustomEvent.

  8. Click Save to confirm your changes without activating this yield group for delivery, or click Save and activate to confirm your changes and immediately approve this yield group for delivery.
  9. Once a yield group has been created and activated, Ad Manager is ready to begin using the yield group to fill requests.
  10. Banner Price Points

    Enter the keyword in the "Keyword targeting" in the following format IMAB:0.00 (ex. IMAB:0.50)

    eCPM

    Keyword

    eCPM

    Keyword

    <0.05

    IMAB:0.05

    1

    IMAB:1.00

    0.1

    IMAB:0.10

    1.2

    IMAB:1.20

    0.2

    IMAB:0.20

    1.4

    IMAB:1.40

    0.3

    IMAB:0.30

    1.6

    IMAB:1.60

    0.4

    IMAB:0.40

    1.8

    IMAB:1.80

    0.5

    IMAB:0.50

    2

    IMAB:2.00

    0.6

    IMAB:0.60

    2.5

    IMAB:2.50

    0.7

    IMAB:0.70

    3

    IMAB:3.00

    0.8

    IMAB:0.80

    3.5

    IMAB:3.50

    0.9

    IMAB:0.90

    >4.00

    IMAB:4.00

    Interstitial Price Points

    Enter the keyword in the "Keyword targeting" in this format IMAB:0.00 (ex. IMAB:0.50)

    eCPM

    Keyword

    eCPM

    Keyword

    <0.50

    IMAB:0.50

    7

    IMAB:7.00

    1

    IMAB:1.00

    8

    IMAB:8.00

    1.5

    IMAB:1.50

    9

    IMAB:9.00

    2

    IMAB:2.00

    10

    IMAB:10.00

    2.5

    IMAB:2.50

    12

    IMAB:12.00

    3

    IMAB:3.00

    14

    IMAB:14.00

    3.5

    IMAB:3.50

    16

    IMAB:16.00

    4

    IMAB:4.00

    18

    IMAB:18.00

    4.5

    IMAB:4.50

    20

    IMAB:20.00

    5

    IMAB:5.00

    22

    IMAB:22.00

    6

    IMAB:6.00

    >24.00

    IMAB:24.00

Step 1.7.1.1.2 Technical Integration Details for Audience Bidding

For Audience Bidding, here are the required changes that you'll need to do in our code:

    • Integration Step 1: Import the InMobi SDK

The IMAudienceBidder is a part of the SDK and will be able to handle most of the functionality required for audience bidding.

#import <InMobiSDK/InMobiSDK.h>
	
    • Integration Step 2: Initialize InMobi Audience Bidder

You MUST initialize the InMobi Audience Bidder before you make an ad request. Typically, the initialization step may take up to 10 seconds. The initialize method will take in your application site ID (from the InMobi platform). If you have problems finding this information, reach out to your account manager.

Note: To set the General Data Protection Regulation (GDPR) user consent flag. Pass YES/true for user consent if GDPR user consent was granted and NO/false if user consent was denied or if unknown.

[IMAudienceBidder initializeWithAppID:kASAppID andUserConsent:@{ IM_GDPR_CONSENT_AVAILABLE : “TRUE” }];
	

Notes:

      • If you would like for InMobi to handle keywords (thus simplifying your integration), follow the below steps for Option A.
      • If you would like to handle the keywords yourself instead, follow the steps for Option B. In addition, you will have to set in customTargeting and set placement id with GADCustomEventExtras using IMABCustomEvent key to DFPRequest object.
    • Integration Step 3: Create or Submit a Bid
      1. Option A: Make an ad request using the bid object

        For Option A, to easily support banner refresh and support subsequent ad requests to the InMobi Audience Bidder, we have a BidObject that you should use.The IMAudienceBidder methods will return a BidObject which you can then call our refreshBid on.

        • The +createBidForAdType: method will return a bidObject which you should retain a strong reference to:
          @property (strong, nonatomic) IMBidObject *bidObject;
          					
        • Please ensure you maintain a strong reference to the DFPRequest:
          @property (strong, nonatomic) DFPRequest *bannerRequest;
          					
        • The +createBidForAdType: method requires for you to pass in an adType, InMobi placement (PLC), DFPRequest, and delegate. Contact your InMobi account manager if you have any questions about this.
        • The adType ENUM: kIMBiddingAdTypeBanner, kIMBiddingAdTypeInterstitial.
        • The setBannerSlotSize:adSize method will use to set the banner size. By default banner size will be 320*50.
        • The +submitBid method will kick off the bidding process with the created bid object. You may review IMAudienceBidder.h for more information.

        A full example snippet for banner and interstitial is available below. InMobi will handle the keywords for you in this option:

        Banner Code Examples

        // CGSize bannerAdSize = CGSizeMake(320, 50);
        // CGSize bannerAdSize = CGSizeMake(300, 250);
        
        GADAdSize customAdSize = GADAdSizeFromCGSize(bannerAdSize);
        self.dfpRequest = [DFPRequest request];
        self.dfpBanner = [[DFPBannerView alloc] initWithAdSize:customAdSize];
        self.dfpBanner.rootViewController = self;
        self.dfpBanner.adUnitID = DFP_BANNER_ADUNIT_ID;
        self.dfpBanner.delegate = self;
        
        // Call createBidForAdType and retain a reference to the bid object to be utilized later
         self.bannerBidObject = [IMAudienceBidder createBidForAdType:kIMBiddingAdTypeBanner withPlacement:AS_BannerID_AB adObj:self.dfpRequest andDelegate:self];
        
        // Set the banner ad size [self.bannerBidObject setBannerSlotSize:bannerAdSize];
        
        // Submit the bid to kick off the bidding process [self.bannerBidObject submitBid];
        				

        Interstitial Code Examples

        self.dfpRequest = [DFPRequest request];
        self.dfpnterstitial = [[DFPInterstitial alloc] initWithAdUnitID:DFP_INT_ADUNIT_ID];
        self.dfpInter.delegate = self;
        
        // Call createBidForAdType and retain a reference to the bid object to be utilized later
        self.interstitialBidOBject = [IMAudienceBiddercreateBidForAdType:kIMBiddingAdTypeInterstitial withPlacement:AS_InterstitialID_AB adObj:self.dfpRequest andDelegate:self];
        
        // Submit the bid to kick off the bidding process [self.interstitialBidOBject submitBid];
        				
      2. Option B: Submit a bid request using submitBidForAdType

        You will not be able to use the BidObject, and you will have to repeatedly call the +submitBidForAdType: method.

        @property (strong, nonatomic) IMBidObject *bidObject;
        				
        • Please ensure you maintain a strong reference to the DFPRequest:
          @property (strong, nonatomic) IMBidObject *bidObject;
          					
        • The +submitBidForAdType: or +submitBidForAdType:adSize method requires for you to pass in an adType, InMobi placement (PLC), and delegate. Contact your InMobi account manager if you have any questions about this.
        • The adType ENUM: kIMBiddingAdTypeBanner, kIMBiddingAdTypeInterstitial
        • The +submitBidForAdType method also will kick off the bidding process (no need to call +submitBid seperately). You may review IMAudienceBidder.h for more information.

    A full example snippet for banner and interstitial is available below. You will handle the keywords in this example. Call submitBidForAdType and do not use a bid object.

    Banner code examples

    GADAdSize customAdSize = GADAdSizeFromCGSize(CGSizeMake(320, 250));
    self.dfpRequest = [DFPRequest request];
    self.dfpBanner = [[DFPBannerView alloc] initWithAdSize:customAdSize];
    self.dfpBanner.rootViewController = self;
    self.dfpBanner.adUnitID = DFP_BANNER_ADUNIT_ID;
    self.dfpBanner.delegate = self;
    
    // Call submitBidForAdType if you plan to add keywords to the object yourself [IMAudienceBidder submitBidForAdType:kIMBiddingAdTypeBanner withPlacement:AS_BannerID_AB adSize:customAdSize andDelegate:self];
    		

    Remember to add the banner to the view and call show on it once you get the bidReceived delegate callback. For more information about DFP banner implementation, you can consult the relevant DFP documentation here: https://developers.google.com/ad-manager/mobile-ads-sdk/ios/banner

    Interstitial Code Examples

    self.dfpRequest = [DFPRequest request];
    self.dfpnterstitial = [[DFPInterstitial alloc] initWithAdUnitID:DFP_INT_ADUNIT_ID];
    self.dfpInter.delegate = self;
    
    // Call submitBidForAdType if you plan to add keywords to the object yourself [IMAudienceBidder submitBidForAdType:kIMBiddingAdTypeInterstitial withPlacement:AS_InterstitialID_AB andDelegate:self];
    		

    Remember to call load on the interstitial once you get the bidReceived delegate callback. You can reference the section below as well to see an example. For more information about DFP interstitial implementation, you can consult the relevant DFP documentation here: https://developers.google.com/ad-manager/mobile-ads-sdk/ios/interstitial.

    Also, do remember to call show when the interstitial has loaded! (when you get the interstitialDidReceiveAddelegate callback from DFP)

  • Integration Step 4: Implement the IMAudienceBidderDelegate Interface
    1. Option A: The IMAudienceBidderDelegate has 2 methods that need to be implemented:
      • -audienceBidderDidReceiveBidFor:
      • -audienceBidderDidFailBidFor:

      In either scenario (banner or interstitial), you will be returned a DFPRequest for banner and interstitial. If a bid was returned from createBidForAdType, you would then be given an updated DFPRequest object. If a bid was not returned from createBidForAdType, you get returned a reference of the DFPRequest object with unmodified keywords. Below is an example delegate implementation covering both banner and interstitial:

       - (void)audienceBidderDidFailBidFor:(id)adObject withError:(NSError* ) error {
      
              // If the returned and updated adObject is a DFPRequest:
      
              if([adObject isKindOfClass:[DFPRequest class]]){
      
                  // Load the banner
      
                  [self.dfpBannerloadRequest:self.dfpRequest];
      
                  // Or load the interstitial
      
                  [self.dfpInterstitial loadRequest:self.dfpRequest];
              }
          }
          - (void)audienceBidderDidReceiveBidFor:(id)adObject {
      
                  // If the returned and updated adObject is a DFPRequest:
      
              if([adObject isKindOfClass:[DFPRequest class]]) {
      
                  // Load the banner
      
                  [self.dfpBanner loadRequest:self.dfpRequest];
      
                  // Or load the interstitial
      
                  [self.dfpInterstitial loadRequest:self.dfpRequest];
              }
          }
      			
    2. Option B: If you prefer to handle keywords yourself, the IMAudienceBidderDelegate has 2 methods that need to be implemented:
      • -audienceBidderDidGenerateBidResponse:
      • -audienceBidderDidFailBidFor:

      For these methods,You would have to append the bid keyword in customTargeting and set placement id with GADCustomEventExtras using IMABCustomEvent key to DFPRequest object. In addition, you may be returned an IMBidResponse object.

      You may access the follow properties on the object:

      • NSString* placement - A NSString that describes the InMobi placement
      • NSString* buyer - A NSString that describes the buyer
      • NSNumber* price - A NSNumber that describes the price
      • NSString* keyword - A NSString that describes a keyword that should be provided to the DFPRequestad object
      • NSString* higherGranularityKeyword - A NSString that describes a granular keyword

      In either scenario (banner or interstitial), if a bid was returned from submitBidForAdType, you would then be given a IMBidResponse object. If a bid was not returned from submitBidForAdType, you do not get returned an IMBidResponse object and you can choose to add additional keywords at this step and/or call loadAd. Below is an example delegate implementation covering both banner and interstitial:

      // Use a Boolean to keep track so you don't call loadAd on the banner repeatedly.
      Boolean bannerLoaded = false;
      
      - (void)audienceBidderDidGenerateBidResponse:(IMBidResponse *)bidResponse
      {NSArray* bidResponseKey = [bidResponse.keyword componentsSeparatedByString:@":"];
      
      NSDictionary *customTargetingDictionary;
      
      if (bidResponseKey.count == 2)
      {customTargetingDictionary = @{bidResponseKey.firstObject:bidResponseKey.lastObject};
      }
      GADCustomEventExtras *extras = [[GADCustomEventExtras alloc] init];
      
      [extras setExtras:@{kIMABLocalCacheKey : bidResponse.placement} forLabel:@"IMABCustomEvent"];
      
      [self.dfpRequest registerAdNetworkExtras:extras];
      
      // If the bid response placement is a banner
      if (bidResponse.placement == AS_BannerID_AB)
      {
      
      // Set or append the returned InMobi bidResponse keywords on the DFPRequest
      self.dfpRequest.customTargeting = customTargetingDictionary;
      
      // Set the local extras of the adview
      
      // If the banner has not yet been loaded, call loadAd on the updated DFPView
      if (!bannerLoaded){
      
      [self.dfpBanner loadRequest:self.dfpRequest]];
      }
      }
      else if (bidResponse.placement == AS_InterstitialID_AB)
      {
      
      // Set or append the returned InMobi bidResponse keywords on the interstitial
      self.dfpRequest.customTargeting = customTargetingDictionary
      
      // Set the local extras of the interstitial
      [self.dfpBanner loadRequest:self.dfpRequest];
      			
  • Integration Step 5: Implement Banner Callbacks to Support Banner Refresh with a New Bid

    We support DFP automatic banner refresh in the InMobi Audience Bidder SDK for both implementation options, A and B.

    1. Option A: You'll need to include an +submitBid method call in the DFP adViewDidReceiveAd/ didFailToReceiveAdWithErrordelegate callbacks. This will allow us to provide a fresh bid each time the banner is refreshed.

      Note: The submitBid method should only be called after the banner bid object has been constructed to avoid unexpected behavior.

      - (void)adViewDidReceiveAd:(DFPBannerView *)adView
      {
      
      // Ensure that you do not call loadAd again on the DFP Ad View
      bannerLoaded = true;
      
      // On a successful load, call submitBid for the next refresh
      [self.bannerBidObject submitBid];
      
      - (void)adView:(DFPBannerView *)adView
      didFailToReceiveAdWithError:(GADRequestError *)error
      
      // Ensure that you do not call loadAd again on the DFP Ad View
      bannerLoaded = true;
      
      // On a failed load, still call submitBid for the next banner refresh
      [self.bannerBidObject submitBid];
      			
    2. Option B: You'll need to include a new +submitBidForAdType method call in the DFP adViewDidReceiveAd / didFailToReceiveAdWithErrordelegate callbacks. This will allow us to provide a fresh bid each time the banner is refreshed.
      - (void)adViewDidReceiveAd:(DFPBannerView *)adView
      {
      
      // Ensure that we do not call loadAd again on the DFPView
      bannerLoaded = true;
      
      // On a successful load, do a new submitBidForAdType for the next refresh
      [IMAudienceBidder submitBidForAdType:kIMBiddingAdTypeBanner withPlacement:AS_BannerID_AB andDelegate:self];
      
      - (void)adView:(DFPBannerView *)adView
      didFailToReceiveAdWithError:(GADRequestError *)error
      {
      
      // Ensure that we do not call loadAd again on the DFPView
      bannerLoaded = true;
      
      // On a failed load, still call submitBidForAdType for the next banner refresh
      [IMAudienceBidder submitBidForAdType:kIMBiddingAdTypeBanner withPlacement:AS_BannerID_AB andDelegate:self];
      			
  • Integration Step 6: Get a new interstitial bid
    1. Option A: After an interstitial is shown, you can optionally call 'submitBid' on the interstitial bid object to get a new bid from the InMobi Audience Bidder.

      Note: The submitBid method should only be called after the interstitial bid object has been constructed to avoid unexpected behavior.

      [self.interstitialBidOBject submitBid];
      			
    2. Option B: After an interstitial is shown, you can optionally call 'submitBidForAdType' on to get a new bid from the InMobi Audience Bidder.
      [IMAudienceBidder submitBidForAdType:kIMBiddingAdTypeInterstitial withPlacement:AS_InterstitialID_AB andDelegate:self];
      			
Step 1.7.1.1.3: Testing your Audience Bidding Integration

In order to test your Audience Bidding implementation, you will need to:

      • Make sure you enable test mode on your placement through the UI
      • Set up a line item with:
      1. CPM 0.00
      2. Keyword: IMAB:0.00

Two ways to verify:

    1. Through Charles:
      1. In the ad request we send to DFP (https://pubads.g.doubleclick.net/gampad/ads), check under “Contents” & “JSON Text”, you should see a key value pair of: “cust_params: IMAB:0.00”
    2. Through DFP Reporting:
      1. Make sure the ad filled on testing.
      2. Make sure the numbers align for the newly generated line item at $0.00 (it might take a few minutes for DFP to report it).

Step 1.7.2 Non-Audience Bidding

Perform the following steps to initiate non-Audience bidding:

Step 1.7.2.1: Add DFP to InMobi Adapter

Add the following files from dist/network-support/Google/DFP-CustomEvents/ to your project.


Step 1.7.2.2: Configure Ad Setting on DFP Dashboard

Enter the following information:

  • Class Name: Use one of the following class name.
    • For Banner: AerServDFPCustomEventBanner
    • For Interstitial: AerServDFPCustomEventInterstitial
  • Parameter: AerServ platform ad parameters, in JSON format.

Step 1.7.2.3: Map Plugin Events

InMobi banner events are mapped to DFP's CustomEventBannerDelegate events, as follows:

  • -adViewDidLoadAd: → -customEventBanner:didReceiveAd:
  • -adViewDidFailToLoadAd:withError: → -customEventBanner:didFailAd:
  • -willPresentModalViewForAd: → -customEventBannerWillPresentModal:
  • -willLeaveApplicatonFromAd: → -customEventBannerWillLeaveApplication:
  • -adWasClicked: → -customEventBannerWasClicked: & -customEventBannerWillLeaveApplication:
  • -didDismissModalViewForAd: → -customEventBannerDidDismissModal:

InMobi interstitial events are mapped to DFP's CustomEventInterstitialDelegate events, as follows:

  • -interstitialViewControllerDidPreloadAd: → -customEventInterstitialDidReceiveAd:
  • -interstitialViewControllerAdFailedToLoad:withError: → -customEventInterstitial:didFailAd:
  • -interstitialViewControllerWillDisappear: → -customEventInterstitialWillDismiss:
  • -interstitialViewControllerDidDisappear: → -customEventInterstitialDidDismiss:
  • -interstitialViewControllerWillAppear: → -customEventInterstitialWillPresent:
  • -interstitialViewControllerAdWasTouched: → -customEventInterstitialWasClicked: & -customEventInterstitialWillLeaveApplication:

InMobi rewarded video events are mapped to DFP's GADRewardBasedVideoAdNetworkAdapterProtocol events, as follows:

  • -interstitialViewControllerDidPreloadAd: → -adapterDidRecieveRewardBasedVideoAd:
  • -interstitialViewControllerAdFailedToLoad:withError: → -adapter:didFailToLoadRewardBasedVideoAdwithError:
  • -interstitialViewControllerDidDisappear: → -adapterDidCloseRewardBasedVideoAd:
  • -interstitialViewControllerDidAppear: → -adapterDidOpenRewardBasedVideoAd:
  • -interstitialViewControllerAdWasTouched: → -adapterDidGetAdClick: & adapterWillLeaveApplication:
  • -interstitialViewControllerDidVirtualCurrencyReward:vcData: → -adapter:didRewardUserWithReward:

Step 2: Additional Settings

  • Step 2.1: Disabling App Transport Security for iOS 9+

    For iOS 9+, you will need to disable App Transport Security (ATS). Please refer here for more detail.

    Select your application's Info.plist, right-click on it and open as source code. Copy the following code into your Info.plist's xml.

    <key>NSAppTransportSecurity</key> <dict>
    <key>NSAllowsArbitraryLoads</key><true/> </dict>
    		
  • Step 2.2: iOS 12 Wifi Settings

    Step 2.2.1: Enable XCode WiFi Settings

    From iOS 12 onwards Apple has introduced privacy settings to access WiFi details. If the publisher decides to share wifi details, they can take advantage of targeted ads. Benefits of ad targeting are that, the ads are more useful and meaningful to users.

    How to enable Access Wifi Information

    1. Enable access WiFi information feature to your App ID.

    2. Enable access WiFi information feature for your target app from XCode capabilities.

    3. WiFi Access should get added to your App.entitlements file. If not please add the following code to your App.entitlements file.
      <dict>
           <key>com.apple.developer.networking.wifi-info</key>
           <true/>
      </dict>
      			

  • Step 2.2.2: AVAudioSession event changes in WKWebView

    WKWebView ignores AVAudioSessionCategory, Publisher can handle audio interruptions by registering to observe AVAudioSessionInterruptionnotification posted by AVAudioSession. Publisher should ensure minimum possible disruption, and the most graceful possible recovery, from the perspective of the user.

  • Step 2.2.3: Observing Audio Interruptions

    To handle audio interruptions, begin by registering to observe notifications of type AVAudioSessionInterruptionNotification.

    - (void)adViewDidReceiveAd:(DFPBannerView *)adView
    {
    
    // Ensure that we do not call loadAd again on the DFPView
    bannerLoaded = true;
    
    // On a successful load, do a new submitBidForAdType for the next refresh
    [IMAudienceBidder submitBidForAdType:kIMBiddingAdTypeBanner withPlacement:AS_BannerID_AB andDelegate:self];
    
    - (void)adView:(DFPBannerView *)adView
    didFailToReceiveAdWithError:(GADRequestError *)error
    {
    
    // Ensure that we do not call loadAd again on the DFPView
    bannerLoaded = true;
    
    // On a failed load, still call submitBidForAdType for the next banner refresh
    [IMAudienceBidder submitBidForAdType:kIMBiddingAdTypeBanner withPlacement:AS_BannerID_AB andDelegate:self];
    		

    The posted NSNotification instance contains a userInfo dictionary providing the details of the interruption. You can determine the type of interruption by retrieving the AVAudioSessionInterruptionType value from the userInfo dictionary. The interruption type indicates whether the interruption has begun or has ended. If the interruption type is AVAudioSessionInterruptionTypeEnded, the userInfo dictionary might contain an AVAudioSessionInterruptionOptions value. An options value of AVAudioSessionInterruptionOptionShouldResume is a hint that indicates whether your app should automatically resume playback if it had been playing when it was interrupted. Media playback apps should always look for this flag before beginning playback after an interruption. If it’s not present, playback should not begin again until initiated by the user. Apps that don’t present a playback interface, such as a game, can ignore this flag and reactivate and resume playback when the interruption ends.

    Please Note: There is no guarantee that a begin interruption will have a corresponding end interruption. Your app needs to be aware of a switch to a foreground running state or the user pressing a Play button. In either case, determine whether your app should reactivate its audio session.

    For more details, please refer to the following:

    1. https://developer.apple.com/documentation/avfoundation/avaudiosession/1616596-interruptionnotification
    2. https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html

Version History

SDK 9.0

  • 9.0.0: 9/20/19

    - Changes to support iOS 13

    - New and improved Modularised SDK design

    - Add InMobiMediationSDK.framework to your project for AerServ Mediation.

    - Addressing issue with layering of FAN banners upon refresh

    - SKStoreProductViewController crash fix.

    - Removed Support for iOS 8.

    - Removed Support for AerServ Native ad format.

    - Removed UIWebView from InMobi SDK. Viewability Partners might be using it.

    - Size reduction for both Framework and ipa inflation.

    - Various Bug Fixes and performance improvements

    - Adapter updates for the following mediation partners:

    • MoPub - v5.9.0
    • Google Mobile Ads - v7.50.0

    - APIs Added

    • IMBanner Class

      + -(void)cancel;

    • IMInterstitial Class

      + -(void)cancel;

    - APIs Added
    • ASAdView Class

      - @property (nonatomic, assign) ASEnvironmentType env;

      - @property (nonatomic, assign) ASPlatformType platform;

      - @property (nonatomic, assign) BOOL isMuted;

      - @property (nonatomic, assign) BOOL outlineAd;

      - @property (nonatomic, assign) BOOL sizeAdToFit;

      - @property (nonatomic, assign) BOOL useHeaderBidding;

      - @property (nonatomic, strong) NSArray* keyWords;

      - @property (nonatomic, assign) BOOL allowAdvertiserCloseButton;

      - -(void)forceRefreshAd;

      - -(CGSize)adContentSize;

      - -(void)rotateToOrientation:(UIInterfaceOrientation)newOrientation;

      - -(void)play;

      - -(void)pause;


    • ASAdViewDelegate Protocol

      - -(void)willLeaveApplicatonFromAd:(ASAdView*)adView;

      - -(void)adSizeChanged:(ASAdView*)adView;

      - -(void)adView:(ASAdView*)adView didFireAdvertiserEventWithMessage:(NSString*)msg;


    • ASInterstitialViewController Class

      - @property (nonatomic, assign) ASEnvironmentType env;

      - @property (nonatomic, assign) ASPlatformType platform;

      - @property (nonatomic, assign) BOOL isMuted;

      - @property (nonatomic, assign) BOOL showOutline;

      - @property (nonatomic, assign) BOOL useHeaderBidding;

      - -(void)play;

      - -(void)pause;


    • ASInterstitialViewControllerDelegate Protocol

      - -(void)interstitialViewControllerAdInteraction:(ASInterstitialViewController*)viewController;

      - -(void)interstitialViewController:(ASInterstitialViewController*)viewController didFireAdvertiserEventWithMessage:(NSString*)msg;

  • 8.2.0: 8/5/19
    • Chrome Custom tabs support
    • Thread Optimizations
    • Bug Fixes for SDK and AudienceBidder Plugin
  • 8.1.2: 7/18/19
    • Size reduction
    • Support for Audience Bidding for DFP
    • New api to set slot size for Banner in Audience Bidding
  • 8.1.1: 6/19/19
    • Updated AdColony SDK support to 3.3.10
    • Updated Audience Network (Facebook) support to 5.3.1
  • 8.1.0: 5/14/19
    • DFP Plugin Support
    • Mopub Audience Bidding Plugin Keyword Handling
    • Bug fixes
  • 8.0.8: 4/17/19
    • Bug Fixes
  • 8.0.7: 4/05/19
    • Additional support for higher granularity keywords
  • 8.0.5: 3/11/19
    • Audience Bidder for the Mopub Plugin
    • Telaria Adapter Deprecation
    • Flurry Banner Adapter Deprecation
    • Applovin 3rd Party API Reporting updates
    • Chartboost 3rd Party API Reporting updates
    • Mediated SDK updates
    • Bug Fixes
  • 8.0.2: 12/13/18
    • Mediation bug Fixes
  • 8.0.1: 11/28/18
    • Unified InMobi + AerServ SDK