Example #1
0
        public bool ShowAd()
        {
            if (m_RewardVideoHandler == null)
            {
                return(false);
            }

            AppLovin.ShowRewardedInterstitialForZoneId(m_RewardVideoHandler.GetAdConfig().unitID);
            return(true);
        }
Example #2
0
        public bool PreLoadAd()
        {
            if (m_RewardVideoHandler == null)
            {
                return(false);
            }

            if (m_RewardBasedVideoAd == null)
            {
                m_RewardBasedVideoAd = RewardBasedVideoAd.Instance;

                m_RewardBasedVideoAd.OnAdLoaded             += HandleOnAdLoaded;
                m_RewardBasedVideoAd.OnAdFailedToLoad       += HandleOnAdFailedToLoad;
                m_RewardBasedVideoAd.OnAdOpening            += HandleOnAdOpened;
                m_RewardBasedVideoAd.OnAdClosed             += HandleOnAdClosed;
                m_RewardBasedVideoAd.OnAdLeavingApplication += HandleOnAdLeftApplication;
                m_RewardBasedVideoAd.OnAdStarted            += HandleOnAdStarted;
                m_RewardBasedVideoAd.OnAdRewarded           += HandleOnAdRewarded;
            }

            if (m_RewardBasedVideoAd.IsLoaded())
            {
                return(false);
            }

            var adConfig = m_RewardVideoHandler.GetAdConfig();

            m_RewardBasedVideoAd.LoadAd(AdmobAdsAdapter.BuildRequest(adConfig), adConfig.unitID);

            return(true);
        }