DFP ad problem with Xcode 7

337 views
Skip to first unread message

Wing Chan

unread,
Oct 13, 2015, 5:53:15 AM10/13/15
to Google Mobile Ads SDK Developers
hi, we've found that the ad's layout has problem when build the app with Xcode 7.0.1.

The ad banner is build with html. Compare with Xcode 6.4's version, the ad banner has extra buffer at the top and left side (see attached screen).


iOS Mobile Ads SDK version you're using:
7.5.1

Model and OS version of the device that exhibits the issue:
iPhone 6 plus

Code:

DFPBannerView* vAdBanner = [[DFPBannerView alloc] initWithAdSize:kGADAdSizeBanner];
[vAdBanner setBackgroundColor:[UIColor greenColor]];
[vAdBanner setRootViewController:self];
[vAdBanner setAdUnitID:@"...."];
[vAdBanner setDelegate:self];
[vAdBanner setAdSizeDelegate:self];
[vAdBanner setAppEventDelegate:self];
[self.view addSubview:vAdBanner];

{
  CGRect rect = vAdBanner.frame;
  rect.origin.x = 50;
  rect.origin.y = 50;
  [vAdBanner setFrame:rect];
}

NSMutableArray *validSizes = [NSMutableArray array];

[validSizes addObject:[NSValue valueWithBytes:&GADAdSizeFromCGSize(CGSizeMake(320, 96)) objCType:@encode(GADAdSize)]];

[vAdBanner setValidAdSizes:validSizes];

GADRequest *request = [GADRequest request];

GADExtras* extras = [[GADExtras alloc] init];
extras.additionalParameters = [NSDictionary dictionaryWithObjectsAndKeys:@"....", @"....", nil];
[request registerAdNetworkExtras:extras];

[vAdBanner loadRequest:request];


IMG_0801.PNG
IMG_0802.PNG

Vu Chau (MobileAds SDK Team)

unread,
Oct 13, 2015, 4:57:55 PM10/13/15
to Google Mobile Ads SDK Developers
Hi Wing,

Would you be able to send us the ad unit ID you are seeing this issue with?  You can send it privately via the option available on this forum.

Thanks,

Vu Chau
Mobile Ads SDK Team

Wing Chan

unread,
Oct 13, 2015, 10:34:09 PM10/13/15
to Google Mobile Ads SDK Developers
hi, I cannot find the option so will send you via Email.

Wing Chan

unread,
Oct 13, 2015, 10:38:28 PM10/13/15
to google-adm...@googlegroups.com
hi, I cannot find the option so send you via Email.

-----
Ad ID: "/1706002/Mobile-320x50”

Additional Parameters: 
[NSDictionary dictionaryWithObjectsAndKeys:@"Wing", @"isDemo",nil];
-----

I also found that the ad banner URL should use “https" instead of “http”, otherwise the ad banner will not be display, even the callback says received the ad.


thanks,

Wing Chan


--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/jQ3oZG4s0OI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vu Chau (MobileAds SDK Team)

unread,
Oct 14, 2015, 2:15:16 PM10/14/15
to Google Mobile Ads SDK Developers
Hi Wing Chan,

Thanks for sending over your ad unit ID, but I wasn't able to test since it continuously resulted in no fills.  Could you double check on this?

I compiled the sample app using the default ad unit ID from both Xcode versions, and the banners I got back were identical.  There was no buffer or offset.

Vu Chau
Mobile Ads SDK Team

On Tuesday, October 13, 2015 at 10:38:28 PM UTC-4, Wing Chan wrote:
hi, I cannot find the option so send you via Email.

-----
Ad ID: "/1706002/Mobile-320x50”

Additional Parameters: 
[NSDictionary dictionaryWithObjectsAndKeys:@"Wing", @"isDemo",nil];
-----

I also found that the ad banner URL should use “https" instead of “http”, otherwise the ad banner will not be display, even the callback says received the ad.


thanks,

Wing Chan


To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Wing Chan

unread,
Oct 15, 2015, 6:01:29 AM10/15/15
to google-adm...@googlegroups.com
hi Vu Chau, 

I’ve attached my sample project used for testing, hope it helps.

Remind that I’m using Xcode 7.0.1 and run with iPhone 6 plus.





thanks,

Wing Chan


To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

Vu Chau (MobileAds SDK Team)

unread,
Oct 16, 2015, 12:56:21 PM10/16/15
to Google Mobile Ads SDK Developers
Hi Wing Chan,

Thanks for sending your project to us.  I walked through your code, and found a number of points worth discussing:
  1. I see that you are setting and requesting for a custom DFP banner size.  It looks like this is where the UI rendering issue originates from.  Once I changed the dimensions to say, 320x50, and used our test ad unit ID (/6499/example/banner), which requests a 320x50 banner, the buffer problem went away (see screenshot).  I was experimenting with this using Xcode 7.
  2. If you would like to request a custom banner size, we do have a supported method for doing so.  Just make sure the dimensions specified in the ad request match that of the DFPBannerView. 
Let us know if that resolves the issue,

Vu Chau
Mobile Ads SDK Team

On Thursday, October 15, 2015 at 6:01:29 AM UTC-4, Wing Chan wrote:
hi Vu Chau, 

I’ve attached my sample project used for testing, hope it helps.

Remind that I’m using Xcode 7.0.1 and run with iPhone 6 plus.





thanks,

Wing Chan


Wing+Chan.png
Sample+DFPBanner.png

Wing Chan

unread,
Oct 21, 2015, 10:51:50 PM10/21/15
to google-adm...@googlegroups.com
hi, I’ve tried the supported method with the same testing project, the result is cannot display the banner, and the log shows this error msg:

"<Google> Unable to set adSize property. Not enough space to show ad with custom size, {320, 96}. Please use a size the fits the current screen bounds of {0, 0}.”

Attached photo shows my code changes.

——————————
——————————



Apart from this, the supported method seems only support one fixed size of banner, but the final goal of my testing is to support dynamic banner size (eg. 320x50, 320x96, 320x200), which’s work normally in our apps that publish with Xcode 6.4.

Dynamic banner size method we’ve using in our apps:

——————————
——————————

Please let me know if there’s any solution.


thanks,

Wing Chan


[validSizes addObject:[NSValue valueWithBytes:&GADAdSizeFromCGSize(CGSizeMake(320, 96))objCType:@encode(GADAdSize)]];

[vAdBanner setValidAdSizes:validSizes];

GADRequest *request = [GADRequest request];

GADExtras* extras = [[GADExtras alloc] init];
extras.additionalParameters = [NSDictionary dictionaryWithObjectsAndKeys:@"....", @"....", nil];
[request registerAdNetworkExtras:extras];

[vAdBanner loadRequest:request];

-- 

--- 
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/jQ3oZG4s0OI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 

--- 
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/jQ3oZG4s0OI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 

--- 
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/jQ3oZG4s0OI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
<Wing+Chan.png><Sample+DFPBanner.png>

Vu Chau (MobileAds SDK Team)

unread,
Oct 22, 2015, 1:41:35 PM10/22/15
to Google Mobile Ads SDK Developers
Hi Wing Chan,

When you try to request a custom size of 320x96, the creative itself should also be in 320x96, not 320x50 as seen from the ad unit ID from your code.  I attached a screenshot where I forced a "custom" size of 320x50 for our sample 320x50 ad unit ID.  If there is not enough space on the screen, then no ad will be shown.  I'd double check to make sure that all the custom sizes you are requesting are also trafficked to that specific ad unit ID.  If you have several sample creatives with different sizes to spare, try redoing the experiment to see if you obtain different results. 

On the same documentation page you should also see a section for handling multiple custom sizes in your ad request.  If you haven't tried it already, check it out and let us know if it works for your use case.

Cheers,

Vu Chau
Mobile Ads SDK Team

On Wednesday, October 21, 2015 at 10:51:50 PM UTC-4, Wing Chan wrote:
hi, I’ve tried the supported method with the same testing project, the result is cannot display the banner, and the log shows this error msg:

"<Google> Unable to set adSize property. Not enough space to show ad with custom size, {320, 96}. Please use a size the fits the current screen bounds of {0, 0}.”

Attached photo shows my code changes.

——————————
——————————



Apart from this, the supported method seems only support one fixed size of banner, but the final goal of my testing is to support dynamic banner size (eg. 320x50, 320x96, 320x200), which’s work normally in our apps that publish with Xcode 6.4.

Dynamic banner size method we’ve using in our apps:

——————————
——————————

Please let me know if there’s any solution.


thanks,

Wing Chan


...

Wing Chan

unread,
Oct 22, 2015, 9:41:17 PM10/22/15
to google-adm...@googlegroups.com
hi, the banner size I'm requesting is 320x96, and the banner I actually want to display is 320x96, only the ad unit ID using text of “320x50” 😛 (which is our minimum size of the multiple size banners).

For your remarked method for displaying multiple banner size, I think this is the method I’m using in our live apps (not in the testing project). We’d like to fix the buffer problem first.


thanks,

Wing Chan


To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
Message has been deleted

Tristan Emrich

unread,
Oct 23, 2015, 8:17:57 PM10/23/15
to Google Mobile Ads SDK Developers
Hi Wing Chan,

It looks like the issue might be coming from your iFrameA element src (https://app.gohome.com.hk/Consumer/Web/NewDevelpment/CampaignBanner_v2.aspx?lang=tc&width=320&row=2). The body tag has a default padding ~8px and when the creative is loaded and displayed in the WebView (in your app), that padding is being added to the banner on an iOS9 device. I was able to confirm that the extra padding does not exist in iOS8.1, so there might be a difference between iOS8.1 and iOS9 and how the creative is displayed in the WebView.

Try setting the body padding and margin to 0px in your iFrameA src and see if that does it.

Please let me know if you have any additional questions.

Thank you!
Tristan


On Thursday, October 22, 2015 at 6:41:17 PM UTC-7, Wing Chan wrote:
hi, the banner size I'm requesting is 320x96, and the banner I actually want to display is 320x96, only the ad unit ID using text of “320x50” 😛 (which is our minimum size of the multiple size banners).

For your remarked method for displaying multiple banner size, I think this is the method I’m using in our live apps (not in the testing project). We’d like to fix the buffer problem first.


thanks,

Wing Chan


...
Reply all
Reply to author
Forward
Message has been deleted
0 new messages