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(); }
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(); }
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); }
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); }
void OnApplicationFocus(bool hasFocus) { if (hasFocus) { FreestarUnityBridge.Resume(); } else { FreestarUnityBridge.Pause(); } }
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); }
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); }
//Be sure to unRegister before loading a new scene. private void unRegisterAdListener() { FreestarUnityBridge.removeBannerAdListener(); FreestarUnityBridge.removeRewardedAdListener(); FreestarUnityBridge.removeInterstitialAdListener(); }
private void showRewardedAd() //called when btnShowReward Clicked { log("Show Reward Ad..."); FreestarUnityBridge.showRewardedAd("", 30, "coins", "", "qwer1234"); }
//===============Rewarded Video Ad Methods=============== /** * Called when Load Rewarded Ad button is clicked */ public void loadRewardedAd() { log("Load Reward Ad..."); FreestarUnityBridge.loadRewardedAd(""); }
private void showInterstitialAd() { log("Show Interstitial Ad..."); FreestarUnityBridge.showInterstitialAd(""); }
//===============Interstitial Ad Methods=============== public void loadInterstitialAd() //called when Interstitial button clicked { log("Load Interstitial Ad..."); FreestarUnityBridge.loadInterstitialAd(""); }
//===============Rewarded Video Ad Methods=============== /** * Called when Load Rewarded Ad button is clicked */ public void loadRewardedAd() { updateStatusUI("Loading rewarded..."); FreestarUnityBridge.LoadRewardedAd(""); }
//===============Interstitial Ad Methods=============== public void loadInterstitialAd() //called when Interstitial button clicked { updateStatusUI("Loading interstitial..."); FreestarUnityBridge.LoadInterstitialAd(""); }