Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 132

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
02/24/15 04:25 AM (9 years ago)

Admob Banners when rotated problem IOS BT3

With the help of a couple of posts, I have managed to get admob banners working on an IOS BT3 app. I used the approach of where to put the code based on tis thread: http://www.buzztouch.com/forum/thread.php?tid=B533B9AE10D8EA7BD41CEC5&command=isSearching&currentPage=1&topicTitle=admob&createdBy=&repliedBy=&minViews=-1&maxViews=-1&minReplies=-1&maxReplies=-1&forumCategory= I also used the techniques from this thread https://www.buzztouch.com/forum/thread.php?tid=BE13504D728DD566D5123B2&sortColumn=FT.id&sortUpDown=DESC&currentPage=2 Banners look good if I start the app in landscape, or portrait, but if I rotate the device, the code does not detect that. I'm using admob sdk 6.12.2; I thought if I upgraded that might help, but can't get the latest Admob library to be recognised when I install it - clearly I'm doing something wrong there. Anyone cracked this or has an idea on how to detect and manage the rotation please?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/24/15 04:44 AM (9 years ago)
bannerView_.autoresizingMask = UIViewAutoresizingFlexibleWidth; add it before you add to the subview
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/24/15 06:39 AM (9 years ago)
That did something. If I start in portrait, all is good, banners at the bottom as they should be. Then if I rotate, no banners visible in landscape. That is what I had before as well. If I start in landscape, I see banners at the bottom, as they should be. Then if I rotate to portrait, I do not see any banners. Before if I started in landscape then rotated, the banner would appear half way up the screen, so this is an improvement from that perspective.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/24/15 08:42 AM (9 years ago)
It seems to be to do with postioning the banners at the bottom of the screen. If I move them to the top, it work. Not the design I was planning though.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/24/15 09:21 AM (9 years ago)
It is were are you putting the code. if btviewcontroller look were the iad banner is changed it will have a rotation method. If it is in the plugin itself all rotations are managed in the layoutScreen method. so change the frames in them methods
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/26/15 10:33 AM (9 years ago)
Been wrestling with this for a while. Thought I'd go back and check with iAd and I noticed a similar problem. If you start in portrait, show an ad, rotate, iad does not position the banner at the very bottom correctly on iphone 4, 5 or 6 landscape. iPad seems OK.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/27/15 11:13 AM (9 years ago)
Noticed this in the log today: You are currently using version 6.12.2 of the SDK, which doesn't officially support iOS 8. Please consider updating your SDK to the most recent sdk version, 7.0.0, to get iOS 8 support, including a fix for smart banner rendering in landscape mode. Problem with the latest sdk is that it doesn't want to play nice in my project. One day...
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.