When using the 'adivery' Flutter plugin (v4.8.x), I observe that _onInterstitialShown callback is triggered multiple times (8+) for a single interstitial ad display, even though initialize() is only called once.
-- I traced the issue to the native plugin implementation in AdiveryPlugin.java:
It calls Adivery.addGlobalListener(listener) on each initialize() call, without checking isInitialized. As a result, multiple listeners accumulate, causing duplicate callback invocations.
Suggested fix:
case "initialize":
if (!isInitialized) {
Adivery.configure(...);
Adivery.addGlobalListener(listener);
isInitialized = true;
}
break;
Also in onDetachedFromEngine, add:
if (isInitialized) {
Adivery.removeGlobalListener(listener);
isInitialized = false;
}
When using the 'adivery' Flutter plugin (v4.8.x), I observe that
_onInterstitialShowncallback is triggered multiple times (8+) for a single interstitial ad display, even thoughinitialize()is only called once.-- I traced the issue to the native plugin implementation in
AdiveryPlugin.java:It calls
Adivery.addGlobalListener(listener)on eachinitialize()call, without checkingisInitialized. As a result, multiple listeners accumulate, causing duplicate callback invocations.Suggested fix: