diff --git a/MgAdmob/Services/Interstitial/MgInterstitialService.android.cs b/MgAdmob/Services/Interstitial/MgInterstitialService.android.cs index 9f79d21..44a0589 100644 --- a/MgAdmob/Services/Interstitial/MgInterstitialService.android.cs +++ b/MgAdmob/Services/Interstitial/MgInterstitialService.android.cs @@ -55,14 +55,12 @@ public void ShowInterstitial() if (!IsLoaded) { - _interstitialAd.Show(Android.App.Application.Context.GetActivity()); - - _interstitialAd = null; - } - else - { - throw new ApplicationException("Interstitial Ad not loaded, call LoadInterstitial() first"); + throw new ApplicationException($"Interstitial Ad not loaded, call {nameof(LoadInterstitial)}() first"); } + + _interstitialAd.Show(Android.App.Application.Context.GetActivity()); + + _interstitialAd = null; } public override void OnInterstitialAdLoaded(InterstitialAd interstitialAd) @@ -72,10 +70,10 @@ public override void OnInterstitialAdLoaded(InterstitialAd interstitialAd) _interstitialAd = interstitialAd; _interstitialAd.FullScreenContentCallback = new MgInterstitialFullScreenContentCallback(_implementation); - + _implementation.OnInterstitialLoaded(); } - + public override void OnAdFailedToLoad(LoadAdError error) { base.OnAdFailedToLoad(error); diff --git a/MgAdmob/Services/Interstitial/MgInterstitialService.apple.cs b/MgAdmob/Services/Interstitial/MgInterstitialService.apple.cs index da4e969..41e142c 100644 --- a/MgAdmob/Services/Interstitial/MgInterstitialService.apple.cs +++ b/MgAdmob/Services/Interstitial/MgInterstitialService.apple.cs @@ -101,7 +101,7 @@ public void ShowInterstitial() if (!IsLoaded) { - throw new ApplicationException("Interstitial Ad not loaded, call LoadInterstitial() first"); + throw new ApplicationException($"Interstitial Ad not loaded, call {nameof(LoadInterstitial)}() first"); } var window = UIApplication.SharedApplication.KeyWindow; diff --git a/MgAdmob/Services/Rewarded/MgRewardService.apple.cs b/MgAdmob/Services/Rewarded/MgRewardService.apple.cs index dc3adc2..10c58d2 100644 --- a/MgAdmob/Services/Rewarded/MgRewardService.apple.cs +++ b/MgAdmob/Services/Rewarded/MgRewardService.apple.cs @@ -116,7 +116,7 @@ public void ShowRewardedVideo() if (!IsLoaded) { - throw new ApplicationException($"Reward Ad not loaded, call {nameof(LoadRewardedVideo)}()"); + throw new ApplicationException($"Reward Ad not loaded, call {nameof(LoadRewardedVideo)}() first"); } var window = UIApplication.SharedApplication.KeyWindow;