Skip to content

Instantly share code, notes, and snippets.

@rtroe
Created March 17, 2018 00:39
Show Gist options
  • Save rtroe/cd56bb7565eb7b17b3f77892ce555be3 to your computer and use it in GitHub Desktop.
Save rtroe/cd56bb7565eb7b17b3f77892ce555be3 to your computer and use it in GitHub Desktop.

Revisions

  1. rtroe created this gist Mar 17, 2018.
    25 changes: 25 additions & 0 deletions AdManageInterstitialInit.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@

    /// <summary>
    /// Adds the initerstialel ad.
    /// </summary>
    /// <param name="adUnitID">Ad unit identifier.</param>
    public void InitIniterstialelAd(string adUnitID)
    {
    this.AdUnitID = adUnitID;
    #if __ANDROID__
    try
    {
    mInterstitialAd.AdUnitId = adUnitID;
    }
    catch (Exception ex)
    {
    Console.WriteLine(ex.Message);
    }
    mInterstitialAd.AdListener = new AdListener();
    #elif __IOS__

    // Intersitials must be re-instantiated each time
    // the ad's are loaded.
    #endif
    LoadIniterstialelAd();
    }