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

Resize ad banner on screen orientation change #55

Open
demiantres opened this issue Nov 24, 2017 · 4 comments
Open

Resize ad banner on screen orientation change #55

demiantres opened this issue Nov 24, 2017 · 4 comments

Comments

@demiantres
Copy link

On iOS (probably also Android) the ad banner does not adapt to a change in the view's width or height properties. The ad banner view should issue a new ad request in case the width or height changes. As an alternative (or better addition) it would be useful to manually tell the ad banner view to send a new ad request.

@larpon
Copy link
Owner

larpon commented Nov 24, 2017

Have you tried setting a new width/height/AdRequest and then reloading the banner?
(you can force reload the banner by calling load()) - I've thought about having a wrap around load() called reload() for clearity

@demiantres
Copy link
Author

I have played around with this but without success because the ad size is set once in the "init()" (respectively "initInternal()" (patch) method.

@demiantres
Copy link
Author

Do you want to to take a look on this, or shall I provide a patch?

@larpon
Copy link
Owner

larpon commented Nov 24, 2017

Ah I see - you're absolutely right.

I think the problem, then, is that it requires a full banner initialization - which earlier (back when I first wrote the code) would crash.

I can see that we call Destroy safely now - but I'm not sure it can be re-initialized a second time.
It might be a left over from trying to keep it stable. But it may also have something to do with AdMob not allowing this on same AdUnitId?

You are welcome to provide a patch - watch out for issue #11
Also watch out for inconsistency between the use of the Position enum and x/y - x and y values aren't updated if you use the Position enums - I never got it to work (but haven't looked at it since v2.1.0 or so)

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