larsacus / LARSAdController

Lightweight ad mediation for iOS to properly manage multiple ad networks dynamically including iAd and Google ads.
http://theonlylars.com/blog/2013/01/10/stupid-easy-ads-with-larsadcontroller-3-dot-0/
MIT License
269 stars 60 forks source link

Tap on Banners does not work reliably #94

Closed glancashire closed 10 years ago

glancashire commented 10 years ago

Dear Lars

First thanks for the great libary. It worked very nicely for me.

I have one issue: the tapping of banners react erratically on my iphone 5s. On my landscape only app both google ads and iads respond very erratically (if at all) to taps.

It works if I comment out LARSAdContainer > hitTest. This seems to be a nasty fix (as I do not fully understand the purpose of the override).

Any clues what the issue is?

Kind Regards Graham

P.S: The integration (or a second libray) for interstitials would be fantastic ;-)

larsacus commented 10 years ago

The only thing that the implementation of hitTest: does is limit touches in LARSAdController to everything contained in the internal container view. This allows me to have a larger view area than the container size, while still allowing taps "through" the ad controller if they are outside of the banner area.

glancashire commented 10 years ago

Thanks for the reply. This seems to cause problems with my landscape only app, it does not respond to touches on the banners. Maybe some issue with container size calculation or similar.

Kind Regards Graham

larsacus commented 10 years ago

If you could enable and print out the debug logging it would be helpful to determine what the issue is, although I've never heard anyone with this issue. Maybe it is something to do with your app being landscape-only.

mrcmd commented 10 years ago

I have experienced the same issue in combination with TOLDeveloperAds. Cannot click banner on iPad in landscape mode. No problem in portrait and on iPhone. Commenting out hitTest resolves the issue.

Please find below debug log.

2014-08-30 10:21:10.411 App[3798:60b] LARSAdController [line 185]: View is landscape
2014-08-30 10:21:10.411 App[3798:60b] LARSAdController [line 222]: Container frame: {{0, 678}, {924, 90}}
2014-08-30 10:21:10.412 App[3798:60b] LARSAdController [line 547]: Creating new instance of adapter class "TOLDeveloperAds"
2014-08-30 10:21:10.416 App[3798:60b] TOLDeveloperAds [line 272]: Reachable via Wifi - Using larger images
2014-08-30 10:21:10.417 App[3798:60b] LARSAdController [line 587]: Successfully created instance of "TOLDeveloperAds"
2014-08-30 10:21:10.420 App[3798:60b] LARSAdController [line 498]: Initial banner frame <Developer Ads>: {{-50, 90}, {1024, 50}}
2014-08-30 10:21:10.421 App[3798:60b] LARSAdController [line 730]: Registering for orientation notifications
2014-08-30 10:21:10.423 App[3798:60b] LARSAdController [line 185]: View is landscape
2014-08-30 10:21:10.423 App[3798:60b] LARSAdController [line 222]: Container frame: {{0, 678}, {924, 90}}
2014-08-30 10:21:10.541 App[3798:60b] LARSAdController [line 756]: Handling orientation change
2014-08-30 10:21:10.581 App[3798:60b] LARSAdController [line 185]: View is landscape
2014-08-30 10:21:10.582 App[3798:60b] LARSAdController [line 222]: Container frame: {{0, 578}, {1024, 90}}
2014-08-30 10:21:10.912 App[3798:60b] LARSAdController [line 657]: Ad loaded for Developer Ads!
2014-08-30 10:21:10.914 App[3798:60b] LARSAdController [line 523]: Final banner frame <Developer Ads>: {{0, 40}, {1024, 50}}
2014-08-30 10:21:16.019 App[3798:60b] LARSAdController [line 185]: View is landscape
2014-08-30 10:21:16.019 App[3798:60b] LARSAdController [line 222]: Container frame: {{0, 578}, {1024, 90}}
2014-08-30 10:21:16.020 App[3798:60b] LARSAdController [line 523]: Final banner frame <Developer Ads>: {{0, 40}, {1024, 50}}
2014-08-30 10:21:20.413 App[3798:60b] TOLDeveloperAds [line 272]: Reachable via Wifi - Using larger images
2014-08-30 10:21:20.817 App[3798:60b] LARSAdController [line 657]: Ad loaded for Developer Ads!
glancashire commented 10 years ago

Dear mrcmd

Thanks for the help and submitting the debug log, hope it helps lars spot the bug.

kind regards

graham

larsacus commented 10 years ago

If someone can try out the change I made in 2bd8e21, I'm 99% sure this was the issue. And it was a dummy mistake on my part.

Always convert your points between view coordinate spaces, kids! The more you know

mrcmd commented 10 years ago

Hi Lars, I can confirm 2bd8e21 does indeed resolve the issue! Thanks for the fix.

larsacus commented 10 years ago

This fix has been deployed to cocoa pods in version 3.0.6

glancashire commented 10 years ago

Dear Lars,

Thanks, but somehow the changes in 3.0.6. broke landscape ads.

I only get 320x50 Banners in Landscape on a iPhone.

This seems to go back to the following change:

TOLAdAdapteriAds.m

If I get rid of the < pre iPhone 6 ifdef landscape ads appear once more.

Kind Regards Graham

larsacus commented 10 years ago

@glancashire Please open up a new issue for this. What version of iOS are you seeing the issue on?