Skip to content

Commit

Permalink
update for depricated ADBannerContentSizeIdentifier480/320 -> landsca…
Browse files Browse the repository at this point in the history
…pe/portraits
  • Loading branch information
sebbie1o1 authored and purplecabbage committed May 16, 2012
1 parent b66b2a6 commit 38ac83b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions iOS/AdPlugin/SAiOSAdPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ - (void) orientationChanged:(NSMutableArray*)arguments withDict:(NSMutableDictio
// landscape
case 90:
case -90:
self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;
self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
self.isLandscape = YES;
break;
// portrait
case 0:
case 180:
self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
self.isLandscape = NO;
break;
default:
Expand Down Expand Up @@ -146,11 +146,13 @@ - (void) __prepare:(BOOL)atBottom

self.adView = [[ADBannerView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
// we are still using these constants even though they are deprecated - if it is changed, iOS 4 devices < 4.3 will crash.
// will need to do a run-time iOS version check
self.adView.requiredContentSizeIdentifiers = [NSSet setWithObjects: ADBannerContentSizeIdentifier320x50, ADBannerContentSizeIdentifier480x32, nil];
// will need to do a run-time iOS version check
self.adView.requiredContentSizeIdentifiers = [NSSet setWithObjects: ADBannerContentSizeIdentifierPortrait, ADBannerContentSizeIdentifierLandscape, nil];

self.adView.delegate = self;

NSString* contentSizeId = (self.isLandscape ? ADBannerContentSizeIdentifier480x32 : ADBannerContentSizeIdentifier320x50);
NSString* contentSizeId = (self.isLandscape ? ADBannerContentSizeIdentifierLandscape : ADBannerContentSizeIdentifierPortrait);

self.adView.currentContentSizeIdentifier = contentSizeId;

if (atBottom) {
Expand Down

0 comments on commit 38ac83b

Please sign in to comment.