You are here: Developers > OpenX Bidder for Apps iOS > OXMQueuedBidderManager

OXMQueuedBidderManager (recommended)

Last updated on July 27, 2017

  1. Initialize the OpenX SDK at app launch:
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    				
    	//Required: Initialize OpenX Ads
    	[OXMBidderForAppsConfiguration initializeSDK];
    	return YES;
    }
    		

    OXMQueuedBidderManager is the recommended class for implementing OpenX BidderOpenX's header bidding solution. Bidder enables publishers to realize the true value of their direct and indirect inventory in real time. "Bidder" can also mean a program designed to bid in real time on inventory in the OpenX Ad Exchange. for Apps. It is useful during infinite scroll scenarios where more than one ad is visible on the screen at once. It also allows you to have a single, global OXMQueuedBidderManager for all ads of a given size or type in your app, which can then be passed to View Controllers.

    
    dispatch_async(dispatch_get_main_queue(), ^{
    
    	// Set parameters
    	OXMAdCallParams* adCallParams = [[OXMAdCallParams alloc] init];
    	adCallParams.appKeywords = @"utility,testing";
    	adCallParams.userGender = OXMGenderMale;
    
    	self.queuedBidderManager = [[OXMQueuedBidderManager alloc] initWithDomain:ExampleDeliveryDomain thirdPartyAdUnitID:@"e4ff514ac14f4ec2a1cc989830cd61df" thirdPartySource:OXMThirdPartySourceMoPub adCallParams:adCallParams queueLength:1];
    
    	[self.queuedBidderManager start];	
    		
  2. Create and configure an OXMAdCallParams instance to set additional data for this ad requestCommunication from a web browser or app to an ad server to display an ad.. This can help increase revenue by revealing the value of your impressions to buyers. For details on what data you can pass, see Data enrichment.

    Once start is called on the OXMQueuedBidderManager, it begins to fill up its queue with ads and automatically replenishes itself when OpenX pulls an OXMBidderResponseContainer out of it with dequeueAd.

    
    				
    @implementation YourViewController
    - (void)viewDidLoad {
     
    	// Dequeue an ad for initial ad load.
    	OXMBidderResponseContainer* container = [self.queuedBidderManager dequeueAd];
     
    	[OXMFunctions setOpenXParamsOnThirdPartyObject:mpAdView bidderResponseContainer:container];
    
    	mpAdView.delegate = self;
    	[mpAdView loadAd];
    }
     
    - (void)adViewDidLoadAd:(MPAdView *)view {
     
    	// Dequeue an ad for an auto refresh.
    	OXMBidderResponseContainer* container = [self.queuedBidderManager dequeueAd];
    
    	[OXMFunctions setOpenXParamsOnThirdPartyObject:mpAdView bidderResponseContainer:container];
    }
     
    - (void)adViewDidFailToLoadAd:(MPAdView *)mpAdView {
    	OXMBidderResponseContainer* container = [self.queuedBidderManager dequeueAd];
    	[OXMFunctions setOpenXParamsOnThirdPartyObject:mpAdView bidderResponseContainer:container];
    }
    
    @end
    		

    Important: To ensure delivery and maximize revenue, please make sure to use setOpenxParamsOnThirdPartyObject as shown above. It is non-destructive to existing keywords, and will remove OpenX keywords if passed a nil bidderResponseContainer.

  3. After you have finished setting up your integration, make sure that it is working correctly by completing the self-test.

Important: Please review the setup checklist. You must complete the self-test before submitting a build to OpenX for final testing. Do not submit your app to the app store before OpenX completes final testing.

See also:

Self-test

Bidder for Apps setup checklist

Data enrichment

OXMBidderResponseContainer

ATS support

Troubleshooting

Flexible ad sizes support

Feedback form