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

GADNativeExpressAdView #40

Closed
bernikovich opened this issue Nov 24, 2016 · 2 comments
Closed

GADNativeExpressAdView #40

bernikovich opened this issue Nov 24, 2016 · 2 comments

Comments

@bernikovich
Copy link

bernikovich commented Nov 24, 2016

Sometimes I see error:

2016-11-24 15:59:57.732 Russian[36147:1904224] <Google> Unable to set adSize property. Not enough space to show ad with custom size, {726, 264}. Please use a size that fits the current screen bounds of {375, 667}.
2016-11-24 15:59:57.754 Russian[36147:1904216] <Google> Invalid Request. Ad size will not fit on screen

But I does not set ad size 726, 264, I set 363, 132. Looks like it's in pixels and compared to screen size in pt.


(lldb) po adSize.size
(width = 363, height = 132)

(lldb) po adSize.flags
1

(lldb) po [UIScreen mainScreen]
<UIScreen: 0x7fa990402e30; bounds = {{0, 0}, {375, 667}}; mode = <UIScreenMode: 0x61000023cfa0; size = 750.000000 x 1334.000000>>

(lldb) po self.superview
<UICollectionView: 0x7fa991875200; frame = (0 0; 375 603); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x618000250980>; layer = <CALayer: 0x6180002369a0>; contentOffset: {0, 0}; contentSize: {375, 262}> collection view layout: <UICollectionViewFlowLayout: 0x7fa9921363d0>

(lldb) po self
<AdsCell: 0x7fa99043a180; baseClass = UICollectionViewCell; frame = (6 124; 363 132); clipsToBounds = YES; layer = <CALayer: 0x6000002341c0>>

(lldb) po self.contentView
<UIView: 0x7fa99043a7f0; frame = (0 0; 363 132); gestureRecognizers = <NSArray: 0x600000258780>; layer = <CALayer: 0x6000002347e0>>

(lldb) po self.contentView.subviews
<__NSArrayM 0x600000259080>(
<UIView: 0x7fa99043aae0; frame = (0 0; 363 132); layer = <CALayer: 0x600000234420>>,
<UIActivityIndicatorView: 0x7fa99043ac80; frame = (171.5 56; 20 20); layer = <CALayer: 0x600000233860>>
)
@ghost
Copy link

ghost commented Nov 30, 2016

Are you able to reproduce this with the Native Express Example or the Native Express UITableView Example?

@ericleich
Copy link
Member

ericleich commented Jan 12, 2017

Based on his gist from #39, it appears to be a custom AdsCell implementation. Size wasn't explicitly set to 363x132, but to the size of the ad container bounds. It's unclear from the gist when your setAdView function gets called, but it could be a race condition between when you create that container and when constraints are set, such that the GADNativeExpressAdView is getting some size that's too big.

Anyhow, since this appears to deviate from the examples themselves, the preferred channel for this question is the developer forum.

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

No branches or pull requests

2 participants