Beispiel #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();
        }
Beispiel #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();
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #5
0
 void OnApplicationFocus(bool hasFocus)
 {
     if (hasFocus)
     {
         FreestarUnityBridge.Resume();
     }
     else
     {
         FreestarUnityBridge.Pause();
     }
 }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #8
0
 //Be sure to unRegister before loading a new scene.
 private void unRegisterAdListener()
 {
     FreestarUnityBridge.removeBannerAdListener();
     FreestarUnityBridge.removeRewardedAdListener();
     FreestarUnityBridge.removeInterstitialAdListener();
 }
Beispiel #9
0
 private void showRewardedAd()           //called when btnShowReward Clicked
 {
     log("Show Reward Ad...");
     FreestarUnityBridge.showRewardedAd("", 30, "coins", "", "qwer1234");
 }
Beispiel #10
0
        //===============Rewarded Video Ad Methods===============

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

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

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

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