예제 #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.");
        }
    }
예제 #2
0
 public void ShowRewardedVideo()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
 }
예제 #3
0
 void FreeCoinsButtonClick()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
 }
예제 #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
        }
예제 #5
0
 /// <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();
     }
 }
예제 #6
0
 /// <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();
     }
 }
예제 #7
0
 public void ContinuePlaying()
 {
     if (AppLovin.IsIncentInterstitialReady())
     {
         AppLovin.ShowRewardedInterstitial();
     }
     else
     {
         AppLovin.LoadRewardedInterstitial();
     }
 }
예제 #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);
    }
예제 #10
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();
        }
    }
 public void ShowVideo()
 {
     AppLovin.ShowRewardedInterstitial();
 }