Search code examples
iosipadadwhirlinmobi

Adwhirl and InMobi on Ipad


I implemented Adwhirl into my new universal app. And was able to get the admob adapter running for Ipad... With help form this great answer...

Now I am stuck implementing InMobi.

I try to change the get ad function but it does not seem to work for me:

IMAdView *inMobiView;
    
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        CGRect adFrame;
        adFrame.size = CGSizeMake(728,90);
        
        inMobiView = [[IMAdView alloc]
                      initWithFrame:adFrame
                      imAppId:[self siteId]
                      imAdUnit:IM_UNIT_728x90
                      rootViewController:[self rootViewControllerForAd]];
        
        
        
    } else {
        
        inMobiView = [[IMAdView alloc]
                                initWithFrame:kAdWhirlViewDefaultFrame
                                imAppId:[self siteId]
                                imAdUnit:IM_UNIT_320x50
                                rootViewController:[self rootViewControllerForAd]];
    }

  inMobiView.refreshInterval = REFRESH_INTERVAL_OFF;
  inMobiView.delegate = self;
  self.adNetworkView = [inMobiView autorelease];

Can you see what I am doing wrong?

Thank you very much for your help.

Greetings

Anselm


Solution

  • Since you've turned "off" the refresh interval, IMAdView does not load ad requests by itself. As per the InMobi & AdWhirl documentation, you just need to add one more line before calling autorelease on inmobiView:

    [inmobiView loadIMAdRequest]; Calling this method will trigger an ad-request immediately, and you can also pass additional parameters by passing an optional IMAdRequest instance.

    IMAdRequest *request = [IMAdRequest request]; //assign optional parameters if required. . . . [inmobiView loadIMAdRequest:request];