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

"Can not load another ad while the ad is showing" when top view controller is dismissed behind the interstitial #343

Open
gerchicov-vg opened this issue Jul 1, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@gerchicov-vg
Copy link

MAX SDK Version

12.1.0 - 12.5.0

Device/Platform Info

iOS 15+

Current Behavior

App dismissed the top view when enters background. If an interstitial ad is currently displayed it becomes hidden but remains in memory and app can't show interstitial ads anymore because of "Can not load another ad while the ad is showing"

Expected Behavior

SDK allows to load another ad or you could provide methods to cleanup the closed ad manually.

How to Reproduce

1)present view controller
2)show interstitial
3)enter background
4)dismiss view controller programmatically

Additional Info

No response

@gerchicov-vg gerchicov-vg added the bug Something isn't working label Jul 1, 2024
@gerchicov-vg
Copy link
Author

I have also found out that this behaviour depends on added mediation pods. If I use pure applovin sdk then everything works.
Pods list:

  pod 'AppLovinMediationAdColonyAdapter'
  pod 'AppLovinMediationFacebookAdapter'
  pod 'AppLovinMediationGoogleAdapter'
  pod 'AppLovinMediationIronSourceAdapter'
  pod 'AppLovinMediationMintegralAdapter'
  pod 'AppLovinMediationTapjoyAdapter'
  pod 'AppLovinMediationUnityAdsAdapter'
  pod 'AppLovinMediationHyprMXAdapter'
  pod 'AppLovinMediationVungleAdapter'
  pod 'AppLovinMediationGoogleAdManagerAdapter'
  pod 'AppLovinMediationByteDanceAdapter'

At least Pangle test ad is not properly closed.

@thomasmso
Copy link
Member

@gerchicov-vg - Ad view controllers are not meant to be programmatically dismissed by the developers even when the app is backgrounded. This should be left to the discretion of the ad SDK. Doing so will result in unexpected behaviour, as you've observed.

@gerchicov-vg
Copy link
Author

gerchicov-vg commented Jul 1, 2024

@thomasmso Why did you immediately close this ticket? It is not resolved.
Push/pop and present/dismiss are basic transitions in iOS. Do you mean a developer should write custom transitions when he uses applovin sdk?

And I just call load() and show() for interstitial ad. I don't dismiss this ad view programmatically - I don't even know which view or view controller "owns" this ad.

@thomasmso thomasmso reopened this Jul 1, 2024
@thomasmso
Copy link
Member

@gerchicov-vg - you mentioned "4)dismiss view controller programmatically", so you are saying you aren't dismissing the view controller programmatically now?

@gerchicov-vg
Copy link
Author

@thomasmso I present my own view controller, then I call interstitial.show(), then I dismiss my own view controller.
I do nothing with the interstitial ad directly

@thomasmso
Copy link
Member

@gerchicov-vg - I see. And you claim that without other ad networks integrated, there were no issues. And you've reproduced it with at least Pangle ads.

ok - let us investigate further on Pangle ads - at the end of the day, their SDK should be able to gracefully handle this condition. But we can reach out to them for this bug as well.

@gerchicov-vg
Copy link
Author

@thomasmso
I use code example from your docs:
https://developers.applovin.com/en/ios/ad-formats/interstitial-ads#showing-an-interstitial-ad

/**
 * Show the loaded interstitial ad.
 * <ul>
 * <li>Use @code -[MAInterstitialAd delegate] @endcode to assign a delegate that should be notified about display events.</li>
 * <li>Use @code -[MAInterstitialAd ready] @endcode to check if an ad was successfully loaded.</li>
 * </ul>
 *
 * @see <a href="https://developers.applovin.com/en/ios/ad-formats/interstitial-ads#showing-an-interstitial-ad">MAX Integration Guide ⇒ iOS ⇒ Ad Formats ⇒ Interstitials ⇒ Showing an Interstitial Ad</a>
 */
- (void)showAd;

In Obj-C they called loadAd and showAd but in Swift they are load and show.

So do you suggest to avoid dismissing any of my own view controllers when the interstitial ad presented? It looks strange but at least show method could return a view controller it uses. So I could prevent or delay dismissing for this view controller if it shows any kind of ads.

@thomasmso
Copy link
Member

@gerchicov-vg - we don't have access to the mediated network's view controller so we can't return that to you when showing. The solution here would be to not update the navigation stack when an ad is showing - operationally it will be nearly impossible to have all ad networks MAX supports support this case. You'll know when an ad is showing and hidden via our - (void)didDisplayAd:(MAAd *)ad and - (void)didHideAd:(MAAd *)ad callbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants