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

Reward Ad Loading Fails After Upgrading from 3.9.2 to 4.1.2 #287

Open
MasatomoFukuda opened this issue Dec 18, 2024 · 2 comments
Open

Reward Ad Loading Fails After Upgrading from 3.9.2 to 4.1.2 #287

MasatomoFukuda opened this issue Dec 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MasatomoFukuda
Copy link

MAX Plugin Version

4.1.2

Flutter Version

3.24.3

Device/Platform Info

iOS 17.6.1 and 18.2

Current Behavior

After upgrading the SDK version from 3.9.2 to 4.1.2, the loading of rewarded video ads fails under specific conditions.
This issue does not occur in versions 3.10.1 or earlier.

Expected Behavior

  1. Launch the app.
  2. Play a rewarded ad and terminate the app midway (task kill).
  3. Restart the app and press the rewarded ad load button.
  4. The ad plays successfully.

How to Reproduce

  1. Launch the app.
  2. Play a rewarded ad and terminate the app midway (task kill).
  3. Restart the app and press the rewarded ad load button.
  4. The ad fails to load (retrying does not resolve the issue).

Reproducible in the demo app?

Yes

Additional Info

I tried to check the error code, but I couldn't confirm it because the onAdLoadFailedCallback was not triggered.

/// Rewarded Ad Listeners
AppLovinMAX.setRewardedAdListener(
  RewardedAdListener(
    onAdLoadedCallback: (ad) {
      _adLoadState = AdLoadState.loaded;

      _logStatus('Rewarded ad loaded from ${ad.networkName}');

      _rewardedAdRetryAttempt = 0;

      _eventController.state = const RewardedAdEvent.onAdLoadedCallback();
      notifyListeners();
    },
    onAdLoadFailedCallback: (adUnitId, error) {
      _adLoadState = AdLoadState.notLoaded;

      _rewardedAdRetryAttempt = _rewardedAdRetryAttempt + 1;

      var retryDelay = pow(2, min(6, _rewardedAdRetryAttempt)).toInt();
      _logStatus(
        '''Rewarded ad failed to load with code ${error.code} - retrying in ${retryDelay}s''',
      );

      // force crash <- not called when load failed
      FirebaseCrashlytics.instance.crash();

      Future.delayed(Duration(milliseconds: retryDelay * 1000), () {
        AppLovinMAX.loadRewardedAd(_unitId);
      });
      _eventController.state =
          const RewardedAdEvent.onAdLoadFailedCallback();
      notifyListeners();
    },
...
@MasatomoFukuda MasatomoFukuda added the bug Something isn't working label Dec 18, 2024
@alhiwatan
Copy link
Collaborator

@MasatomoFukuda, do you mind enabling and providing verbose logs?

@MasatomoFukuda
Copy link
Author

MasatomoFukuda commented Dec 24, 2024

@alhiwatan
This is the staging app's logs when loading failed.

In addition to this, I found that AppLovinMAX.isInitialized() doesn't return true even after AppLovinMAX.initialize(key) had finished successfully.
isInitialized() refer to iOS SDK's isInitialized through invokeMethod.

Is there any change betweens 3.10.1 and thereafter?
Is it possible that isInitialized() returns false after AppLovinMAX.initialize() ?

デフォルト 14:32:00.639616+0900    Runner  AppLovinQualityService top: AppLovinQualityService Client Version: 7.6.5
デフォルト 14:32:00.639748+0900    Runner  AppLovinQualityService top: AppLovinQualityService Device ID: xxxxx
デフォルト 14:32:00.728868+0900    Runner  [AppLovinSdk] DEBUG [ALSdkInitializationConfiguration] Initializing with key: xxxxx
デフォルト 14:32:00.728889+0900    Runner  [AppLovinSdk] DEBUG [ALSdkInitializationConfiguration] -[ALSdkInitializationConfiguration setMediationProvider: max]
デフォルト 14:32:00.729135+0900    Runner  [AppLovinSdk] DEBUG [ALSdk] 
========================================
SDK Session Begin
========================================
デフォルト 14:32:00.734081+0900    Runner  [AppLovinSdk] DEBUG [ALSdkSettings] -[ALSdkSettings setMuted: 1]
デフォルト 14:32:00.784145+0900    Runner  [AppLovinSdk] DEBUG [ALSdk] Setting plugin version: (null)
デフォルト 14:32:00.785231+0900    Runner  [AppLovinSdk] ERROR [ALUtils] Unable to retrieve top view controller
デフォルト 14:32:00.931988+0900    Runner  boringssl_session_apply_protocol_options_for_transport_block_invoke(2007) [C1.1.1.1.1:2][0x104e42f70] TLS configured [min_version(0x0301) max_version(0x0304) name(ms.applovin.com) tickets(false) false_start(false) enforce_ev(false) enforce_ats(false) ech(false)]
デフォルト 14:32:01.282593+0900    Runner  [AppLovinSdk] [AppLovinMAX] Initializing AppLovin MAX Flutter v4.1.1...
デフォルト 14:32:01.282671+0900    Runner  [AppLovinSdk] DEBUG [ALSdkInitializationConfiguration] Initializing with key: xxxxx
デフォルト 14:32:01.282744+0900    Runner  [AppLovinSdk] DEBUG [ALSdkInitializationConfiguration] -[ALSdkInitializationConfiguration setMediationProvider: max]
デフォルト 14:32:01.290218+0900    Runner  [AppLovinSdk] ERROR [ALSdk] AppLovin SDK already initialized with configuration: [ALSdkInitializationConfiguration: sdkKey=xxxxx, mediationProvider=max, pluginVersion=(null), testDeviceAdvertisingIdentifiers=(
), adUnitIdentifiers=(
), isExceptionHandlerEnabled=1, segmentCollection=(null)]. Ignoring the provided initialization configuration.
デフォルト 14:32:01.383908+0900    Runner  [AppLovinSdk] DEBUG [AppLovinSdk] 
========================================
=====AppLovin SDK=====
===SDK Versions===
Version: 13.0.1
Plugin Version: 
Ad Review Version: 7.6.5
OM SDK Version: 1.4.12-Applovin
===Device Info===
OS: iOS 17.6.1
IDFA: <Enable verbose logging to see the IDFA to use for test devices - https://monetization-support.applovin.com/hc/en-us/articles/236114328-How-can-I-expose-verbose-logging-for-the-SDK>
IDFV: <Enable verbose logging to see the IDFV to use for test devices - https://monetization-support.applovin.com/hc/en-us/articles/236114328-How-can-I-expose-verbose-logging-for-the-SDK>
Model: iPhone12,5
Locale: ja_JP
Simulator: 0
Tablet: 0
===App Info===
Bundle ID: xxxxx
Has AppLovinSDKResources: true
NSAdvertisingAttributionReportEndpoint: (null)
===SDK Settings===
SDK Key: xxxxx
Mediation Provider: max
TG: 72
MD: xxxxx<…>
デフォルト 14:32:01.682701+0900    Runner  boringssl_session_apply_protocol_options_for_transport_block_invoke(2007) [C5.1.1.1.1:2][0x104d91220] TLS configured [min_version(0x0301) max_version(0x0304) name(prod-bid.applovin.com) tickets(false) false_start(false) enforce_ev(false) enforce_ats(false) ech(false)]
デフォルト 14:32:01.723526+0900    Runner  boringssl_session_apply_protocol_options_for_transport_block_invoke(2007) [C9.1.1.1.1:2][0x104d97e10] TLS configured [min_version(0x0301) max_version(0x0304) name(rt.applovin.com) tickets(false) false_start(false) enforce_ev(false) enforce_ats(false) ech(false)]
デフォルト 14:32:03.813990+0900    Runner  [AppLovinSdk] DEBUG [ALPrivacySettings] +[ALPrivacySettings setHasUserConsent:]

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