Example #1
0
    public void RunAppLovinAd(AdType type)
    {
        switch (type)
        {
        case AdType.Interstitial:
            if (AppLovin.HasPreloadedInterstitial())
            {
                AppLovin.ShowInterstitial();
            }
            break;

        case AdType.Rewarded:
            if (AppLovin.IsIncentInterstitialReady())
            {
                AppLovin.ShowRewardedInterstitial();
            }
            break;

        case AdType.Banner:
            throw new System.NotImplementedException("Applovin does't have type of Banner.");

        default:
            throw new System.NotImplementedException("Unknown type.");
        }
    }
Example #2
0
 public void ShowRewardedVideo()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
 }
Example #3
0
 void FreeCoinsButtonClick()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
 }
Example #4
0
    public bool isRewardedVideoReady()
    {
#if UNITY_EDITOR
        return(false);
#else
        return(AppLovin.IsIncentInterstitialReady());
#endif
    }
Example #5
0
 public bool IsRewarededInterLoaded()
 {
             #if UNITY_IOS
     if (!IsInit)
     {
         return(false);
     }
             #endif
     return(AppLovin.IsIncentInterstitialReady());
 }
Example #6
0
 public void ContinuePlaying()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
     else
     {
         AppLovin.LoadRewardedInterstitial();
     }
 }
Example #7
0
 public void ShowRewardedInterstitial(Action Success = null, Action Failed = null)
 {
     Debug.Log("avail: " + AppLovin.IsIncentInterstitialReady());
     if (AppLovin.IsIncentInterstitialReady())
     {
         OnRewardedInterClosed = Success;
         OnRewardedInterFailed = Failed;
         AppLovin.ShowRewardedInterstitial();
     }
     else
     {
         Failed();
     }
 }
    public bool ShowRewardedInterstitial() // show video
    {
        if (!AppLovin.IsIncentInterstitialReady())
        {
            _isPreloadingRewardedVideo = true;
            AppLovin.LoadRewardedInterstitial();
        }
        else
        {
            _isPreloadingRewardedVideo = false;
            AppLovin.ShowRewardedInterstitial();
            AppsFlyerManager.Instance.TrackVideoAppLovinView();
            return(true);
        }

        return(false);
    }
Example #9
0
    public void PreloadOrShowRewardedInterstitial()
    {
        if (AppLovin.IsIncentInterstitialReady())
        {
            Log("Showing rewarded ad...");

            IsPreloadingRewardedVideo     = false;
            RewardedVideoButtonTitle.text = REWARDED_VIDEO_BUTTON_TITLE_PRELOAD;

            AppLovin.ShowRewardedInterstitial();
        }
        else
        {
            Log("Preloading rewarded ad...");

            IsPreloadingRewardedVideo     = true;
            RewardedVideoButtonTitle.text = REWARDED_VIDEO_BUTTON_TITLE_LOADING;

            AppLovin.LoadRewardedInterstitial();
        }
    }
Example #10
0
        //------------------------------------------------------------
        // Rewarded Ads.
        //------------------------------------------------------------

        protected override bool InternalIsRewardedAdReady(AdPlacement placement)
        {
#if EM_APPLOVIN
            string id = placement == AdPlacement.Default ?
                        mAdSettings.DefaultRewardedAdId.Id :
                        FindIdForPlacement(mAdSettings.CustomRewardedAdIds, placement);

            if (placement.Equals(AdPlacement.Default)) // Default rewarded ad...
            {
                if (string.IsNullOrEmpty(id))
                {
                    return(AppLovin.IsIncentInterstitialReady());
                }
                else
                {
                    return(AppLovin.IsIncentInterstitialReady(mAdSettings.DefaultRewardedAdId.Id));
                }
            }
            else // Custom rewarded ad...
            {
                if (mAdSettings.CustomRewardedAdIds.ContainsKey(placement))
                {
                    if (string.IsNullOrEmpty(id))
                    {
                        return(AppLovin.IsIncentInterstitialReady());
                    }
                    else
                    {
                        return(AppLovin.IsIncentInterstitialReady(id));
                    }
                }
                else
                {
                    return(false);
                }
            }
#else
            return(false);
#endif
        }
 /// <summary>
 /// Check if AppLovin rewarded video is available
 /// </summary>
 /// <returns>true if a rewarded video is available</returns>
 public bool IsRewardVideoAvailable()
 {
     return(AppLovin.IsIncentInterstitialReady());
 }