Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RevMob adapter - full width landscape #36

Closed
Fred10932 opened this issue Apr 12, 2013 · 7 comments
Closed

RevMob adapter - full width landscape #36

Fred10932 opened this issue Apr 12, 2013 · 7 comments

Comments

@Fred10932
Copy link

I have Revmob working (with AdMob as backup) using below methods, but using the same width for landscape as portrait. If anyone knows a solution, that would be great.

- (RevMobBannerView *)bannerView{
if (_bannerView == nil && _publisherId) {
    [RevMobAds startSessionWithAppID:_publisherId];

    //[RevMobAds session].testingMode = RevMobAdsTestingModeWithoutAds;

    _bannerView = [[RevMobAds session] bannerView];
    _bannerView.delegate = self;
    [_bannerView loadAd];

    // Couldn't get layoutBannerForInterfaceOrientation method working, used this solution for now:

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        _bannerView.frame = CGRectMake(0, 0, 768, 90);
      } else {
        _bannerView.frame = CGRectMake(0, 0, 320, 40);
    }
    [self.bannerView setNeedsLayout];
}
else if(!_publisherId){
    NSLog(@"RevMob Publisher ID not set. No ads will be served until you set one using %@ on %@!", NSStringFromSelector(@selector(registerAdClass:withPublisherId:)),NSStringFromClass([LARSAdController class]));
}
return _bannerView;
}

#pragma mark - Required RevMob methods

-(void)revmobAdDidFailWithError:(NSError *)error {
NSLog(@"Ad failed with error: %@", error);
if ([self.adManager respondsToSelector:@selector(adFailedForNetworkAdapterClass:)]) {
    [self.adManager adFailedForNetworkAdapterClass:[self class]];
}
}

-(void)revmobAdDidReceive {
NSLog(@"Ad loaded successfullly");
if ([self.adManager     respondsToSelector:@selector(adSucceededForNetworkAdapterClass:)]) {
    [self.adManager adSucceededForNetworkAdapterClass:[self class]];
}
}

-(void)revmobAdDisplayed {
NSLog(@"Ad displayed");

}

-(void)revmobUserClickedInTheAd {
NSLog(@"User clicked in the ad");
}

-(void)revmobUserClosedTheAd {
NSLog(@"User closed the ad");
}
@larsacus
Copy link
Owner

Do you have this in a branch I can clone and try out?

@larsacus
Copy link
Owner

Is this the full implementation of the adapter? Or is there a branch I can try out?

@Fred10932
Copy link
Author

Hi Lars
Sorry was out for the weekend. I have a branch ready but need collaborator status to upload.

@larsacus
Copy link
Owner

If you have a fork of the project, you can push the branch up to your own fork.

@Fred10932
Copy link
Author

OK -- see RevMob branch @ https://github.com/Fred10932/LARSAdController.git

@larsacus
Copy link
Owner

I guess I'm really not sure what the specific issue is, but I did clean it up a bit. Check out my RevMob branch.

I'm not sure what it's supposed to look like in landscape as right now all it does is stretch the test ad.

@Fred10932
Copy link
Author

Thanks. I also tested some live banners with your solution and indeed RevMob (there are only a few varieties) doesn't adapt its banners to more screen real estate, they just stretch out.
I think constraining the banner to a 320 (iPhone) or 768 (iPad) width may be the way to go for this adapter after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants