Comments (5)
There is already functionality built into LARSAdController
to support delayed deallocing of adapter instances. It appears that the adapter is returning YES
from -canDestroyAdBanner
Since the only requirement from that method is that isBannerViewActionInProgress
returns NO
. -canDestroyAdBanner
looks like the best place to add more logic for delayed destruction.
from larsadcontroller.
@larsacus, thanks for the reply. How would that stop [self.adapterInstances removeAllObjects] from just clearing all the adapters?
from larsadcontroller.
What is the actual bug being encountered? I assume you're calling destroyAllAdBanners
for a reason.
from larsadcontroller.
The error is the title of this report. I call destroyAllAdBanners
when an ad-free purchase is made. Unfortunately, it it appears the method is destroying the adapters before getting a chance to turn off notifications. My changes seem to be working.
from larsadcontroller.
I apologize, the title was truncated in my email, and I didn't look at it again when I came here.
The solution is actually much simpler than that:
- (void)destroyAllAdBanners{
NSArray *instances = [self.adapterInstances allValues];
for (id <TOLAdAdapter> adapterInstance in instances) {
if (adapterInstance.adVisible) {
[self animateBannerForAdapterHidden:adapterInstance withCompletion:^{
[self cleanUpAdAdapter:adapterInstance];
}];
}
else{
[self cleanUpAdAdapter:adapterInstance];
}
}
}
-cleanUpAdAdapter:
will handle everything needed to remove that instance from its storage arrays and remove all observers. I've updated master with this change.
from larsadcontroller.
Related Issues (20)
- google ads set to appear at top, which are not full-screen width, are placed in top left, not top center. HOT 9
- Blank Presenting View when Added as Subview iOS 8 HOT 2
- Banner position in runtime HOT 5
- GADBannerViewDelegate.h not found - first issue HOT 7
- GADBannerViewDelegate.h not found HOT 9
- Notification on bannerViewActionShouldBegin and bannerViewActionDidFinish HOT 3
- apps orientation settings not inherited? HOT 1
- error "Include of non-modular header inside framework module " HOT 5
- Ads in a list view? HOT 1
- 'interfaceOrientation' is deprecated: first deprecated in iOS 8.0 HOT 1
- Having trouble hiding AdBanner when no ad is visible HOT 11
- Build Error: 'GADBannerViewDelegate.h" not found HOT 11
- Delete HOT 2
- Global Disable Without Subclassing HOT 2
- iPad ContainerView Height Wrong? HOT 1
- 3.1.1 Causing freezing with Google Mobile Ads 7.5.2
- originalContentView with iAds
- In Landscape mode, when using Split View multitasking, ad container is wrong. (found fix!) HOT 3
- Carthage
- Portrait ads do not display correctly on iPad Pro 12.9" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from larsadcontroller.