Skip to content

Commit

Permalink
Fixed refactoring bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mg-code-solutions committed Mar 15, 2022
1 parent ca00f3c commit 068968d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
16 changes: 7 additions & 9 deletions MgAdmob/Services/Interstitial/MgInterstitialService.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion MgAdmob/Services/Rewarded/MgRewardService.apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 068968d

Please sign in to comment.