Exemple #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.");
        }
    }
Exemple #2
0
 public void ShowRewardedVideo()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
 }
Exemple #3
0
 void FreeCoinsButtonClick()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
 }
Exemple #4
0
        protected override void InternalShowRewardedAd(AdPlacement placement)
        {
#if EM_APPLOVIN
            if (placement.Equals(AdPlacement.Default))
            {
                if (string.IsNullOrEmpty(mAdSettings.DefaultRewardedAdId.Id))
                {
                    AppLovin.ShowRewardedInterstitial();
                }
                else
                {
                    AppLovin.ShowRewardedInterstitialForZoneId(mAdSettings.DefaultRewardedAdId.Id);
                }
                currentShowingRewarded = placement;
            }
            else
            {
                if (mAdSettings.CustomRewardedAdIds.ContainsKey(placement))
                {
                    if (string.IsNullOrEmpty(mAdSettings.CustomRewardedAdIds[placement].Id))
                    {
                        AppLovin.ShowRewardedInterstitial();
                    }
                    else
                    {
                        AppLovin.ShowRewardedInterstitialForZoneId(mAdSettings.CustomRewardedAdIds[placement].Id);
                    }
                    currentShowingRewarded = placement;
                }
            }
#endif
        }
 /// <summary>
 /// Show AppLovin rewarded video
 /// </summary>
 /// <param name="CompleteMethod">callback called when user closes the rewarded video -> if true, video was not skipped, also contains the advertiser name of the closed ad</param>
 public void ShowRewardVideo(UnityAction <bool, string> CompleteMethod)
 {
     if (IsRewardVideoAvailable())
     {
         OnCompleteMethodWithAdvertiser = CompleteMethod;
         AppLovin.ShowRewardedInterstitial();
     }
 }
 /// <summary>
 /// Show AppLovin rewarded video
 /// </summary>
 /// <param name="CompleteMethod">callback called when user closes the rewarded video -> if true, video was not skipped</param>
 public void ShowRewardVideo(UnityAction <bool> CompleteMethod)
 {
     if (IsRewardVideoAvailable())
     {
         OnCompleteMethod       = CompleteMethod;
         rewardedVideoCompleted = false;
         AppLovin.ShowRewardedInterstitial();
     }
 }
Exemple #7
0
 public void ContinuePlaying()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
     else
     {
         AppLovin.LoadRewardedInterstitial();
     }
 }
Exemple #8
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);
    }
    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();
        }
    }
 public void ShowVideo()
 {
     AppLovin.ShowRewardedInterstitial();
 }