예제 #1
0
        public void onRewardedAdLoaded(string placement)
        {
            updateStatusUI("Rewarded Ad Winner: " + FreestarUnityBridge.GetRewardedAdWinner(placement) + " Placement: [" + placement + "]");

            //reward ad is ready!  You can display now, or you can wait until a later time.
            showRewardedAd();
        }
예제 #2
0
        public void onInterstitialAdLoaded(string placement)
        {
            //interstitial ad is ready!  You can display now, or you can wait until a later time.
            //updateStatusUI("Interstitial Ad Winner: " + FreestarUnityBridge.GetInterstitialAdWinner(placement) + " Placement: [" + placement + "]");
            string str = "Interstitial: " + FreestarUnityBridge.GetInterstitialAdWinner(placement);

            updateStatusUI(str);
            showInterstitialAd();
        }
예제 #3
0
        public void loadMRECBannerAd()
        {
            log("Load MREC Banner Ad...");
            if (FreestarUnityBridge.IsBannerAdShowing(null, FreestarConstants.BANNER_AD_SIZE_320x50))
            {
                FreestarUnityBridge.CloseBannerAd(null, FreestarConstants.BANNER_AD_SIZE_320x50);
            }

            FreestarUnityBridge.ShowBannerAd(null, FreestarConstants.BANNER_AD_SIZE_300x250, FreestarConstants.BANNER_AD_POSITION_BOTTOM);
        }
예제 #4
0
        public void loadSmallBannerAd()
        {
            updateStatusUI("Loading Banner ad...");
            if (FreestarUnityBridge.IsBannerAdShowing(null, FreestarConstants.BANNER_AD_SIZE_300x250))
            {
                FreestarUnityBridge.CloseBannerAd(null, FreestarConstants.BANNER_AD_SIZE_300x250);
            }

            FreestarUnityBridge.ShowBannerAd(null, FreestarConstants.BANNER_AD_SIZE_320x50, FreestarConstants.BANNER_AD_POSITION_BOTTOM);
        }
예제 #5
0
 void OnApplicationFocus(bool hasFocus)
 {
     if (hasFocus)
     {
         FreestarUnityBridge.Resume();
     }
     else
     {
         FreestarUnityBridge.Pause();
     }
 }
예제 #6
0
        public void onBannerAdShowing(string placement, int adSize)
        {
            if (adSize == FreestarConstants.BANNER_AD_SIZE_300x250)
            {
                updateStatusUI("MREC Ad: " + FreestarUnityBridge.GetBannerAdWinner(placement, adSize));
            }
            else
            {
                updateStatusUI("Banner Ad: " + FreestarUnityBridge.GetBannerAdWinner(placement, adSize));
            }

            log("onBannerAdShowing placement=[" + placement + "] adSize: " + adSize);
        }
예제 #7
0
        private void Start()
        {
            log("Start");

            FreestarUnityBridge.SetAdRequestTestMode(true, "xxxxxxxx"); //OPTIONAL TEST MODE
            FreestarUnityBridge.ShowPartnerChooser(true);               //ONLY FOR TESTING PURPOSES; TURN OFF FOR PRODUCTION!

#if UNITY_ANDROID
            FreestarUnityBridge.initWithAPIKey("XqjhRR");  //Android TEST KEY  Replace with yours in production.
#endif

#if UNITY_IOS
            FreestarUnityBridge.initWithAPIKey("X4mdFv"); //iOS TEST KEY  Replace with yours in production.
#endif

            FreestarUnityBridge.setBannerAdListener(this);
            FreestarUnityBridge.setInterstitialAdListener(this);
            FreestarUnityBridge.setRewardedAdListener(this);
        }
예제 #8
0
 //Be sure to unRegister before loading a new scene.
 private void unRegisterAdListener()
 {
     FreestarUnityBridge.removeBannerAdListener();
     FreestarUnityBridge.removeRewardedAdListener();
     FreestarUnityBridge.removeInterstitialAdListener();
 }
예제 #9
0
 private void showRewardedAd()           //called when btnShowReward Clicked
 {
     log("Show Reward Ad...");
     FreestarUnityBridge.showRewardedAd("", 30, "coins", "", "qwer1234");
 }
예제 #10
0
        //===============Rewarded Video Ad Methods===============

        /**
         * Called when Load Rewarded Ad button is clicked
         */
        public void loadRewardedAd()
        {
            log("Load Reward Ad...");
            FreestarUnityBridge.loadRewardedAd("");
        }
예제 #11
0
 private void showInterstitialAd()
 {
     log("Show Interstitial Ad...");
     FreestarUnityBridge.showInterstitialAd("");
 }
예제 #12
0
        //===============Interstitial Ad Methods===============

        public void loadInterstitialAd()     //called when Interstitial button clicked
        {
            log("Load Interstitial Ad...");
            FreestarUnityBridge.loadInterstitialAd("");
        }
예제 #13
0
        //===============Rewarded Video Ad Methods===============

        /**
         * Called when Load Rewarded Ad button is clicked
         */
        public void loadRewardedAd()
        {
            updateStatusUI("Loading rewarded...");
            FreestarUnityBridge.LoadRewardedAd("");
        }
예제 #14
0
        //===============Interstitial Ad Methods===============

        public void loadInterstitialAd()     //called when Interstitial button clicked
        {
            updateStatusUI("Loading interstitial...");
            FreestarUnityBridge.LoadInterstitialAd("");
        }