Question

I have a huge problem, I've integrated inmobi in my app, which doesnt support interface orientation, but when i press on ad, view is loaded on top and it rotates, this wouldn't be bad, but the when it rotates, the view becomes distorted, not covering full screen, maybe someone has had similar problem? My code:

- (void)showInMobiBanner
{
    if (_inMobView == nil)
    {
        _inMobView = [[IMAdView alloc] init];
        _inMobView.delegate    = self; //optional
        _inMobView.imAppId     = kInMobiAppId;
        _inMobView.imAdUnit    = IM_UNIT_320x50;
        _inMobView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
    }
    if (self.containerView != nil) 
    {
        _inMobView.rootViewController = self.containerView;
    }
    else
    {
        _inMobView.rootViewController = self.navigationController;
    }
        IMAdRequest *request = [IMAdRequest request];
        request.isLocationEnquiryAllowed = NO;

        _inMobView.frame = CGRectMake(0, 0, 320, 50);
        _inMobView.imAdRequest = request;
        [_inMobView loadIMAdRequest:request];
    [self.view addSubview:_inMobView];
}

Thanks in advance!

Was it helpful?

Solution

It seems you're using an older version of InMobi SDK(3.0.2).

There has been a newer version launched very recently: http://developer.inmobi.com/wiki/index.php?title=IOS_SDK_350

A new method has been introduced:

- (BOOL)shouldRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation;

You can make use of this method in your UIViewController, and tackle orientation changes something like this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return [imAdView shouldRotateToInterfaceOrientation:interfaceOrientation];
}

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top