void Ad() { int randomNumber = Random.Range(0, 10); if (hide) { AdMob.destroyBanner(); //oculta banner do AdMob #if UNITY_ANDROID FlurryAndroid.removeAd("main_menu"); //oculta banner do Flurry #endif #if UNITY_IOS FlurryAds.removeAdFromSpace("main_menu"); //oculta banner do Flurry #endif } if (randomNumber <= chance) { if (banner == false && interstitial == false) { banner = true; } if (show && P31Prefs.getInt("rads") == 0) { if (banner) { AdMob.createBanner("ca-app-pub-8470511340989148/5727361119", "ca-app-pub-8470511340989148/7343695112", AdMobBanner.SmartBanner, AdMobBannerLocation); } if (interstitial) { ShowInterstitial(location); } } } }
//EVENTOS// void failedToReceiveAdMob(string error) //SE ADMOB FALHAR { Debug.Log("AdMob falhou: " + error); #if UNITY_ANDROID FlurryAndroid.displayAd("space", FlurryBannerLocation, 1000); //MOSTRA ADS DO FLURRY #endif #if UNITY_IOS FlurryAds.displayAdForSpace("space", FlurryBannerLocation); #endif }
public static void Refresh() { if (P31Prefs.getInt("rads") == 3) { AdMob.destroyBanner(); #if UNITY_ANDROID FlurryAndroid.removeAd("main_menu"); //oculta banner do Flurry #endif #if UNITY_IOS FlurryAds.removeAdFromSpace("main_menu"); #endif } }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { #if DEBUG // enable test ads FlurryAds.EnableTestAds(true); #endif FlurryAgent.StartSession("PQSZJRK4B5BW8Q7YQQXF"); FlurryAgent.SetDebugLogEnabled(true); FlurryAgent.SetLogLevel(FlurryLogLevel.All); Window.MakeKeyAndVisible(); return(true); }
// Use this for initialization void Start() { // Flurry Ads FlurryAnalytics.startSession(flurryAppId, true); FlurryAds.fetchAdsForSpace(adsSpaceBanner, FlurryAdPlacement.BannerBottom); FlurryAds.fetchAdsForSpace(adsSpaceFullScreen, FlurryAdPlacement.FullScreen); // AdColony Ads AdColony.OnVideoStarted = this.OnVideoStarted; AdColony.OnVideoFinished = this.OnVideoFinished; AdColony.OnAdAvailabilityChange = this.OnAdAvailabilityChange; AdColony.OnV4VCResult = this.OnV4VCResult; AdColony.Configure ( "version:1.0,store:google", AdColonyAppId, // app id AdColonyZoneId // zone id ); }
void ShowFullScreen() { FlurryAds.displayAd(adsSpaceFullScreen, FlurryAdPlacement.FullScreen, 1000); }
// For Flurry Ads void ShowBanner() { FlurryAds.displayAd(adsSpaceBanner, FlurryAdPlacement.BannerBottom, 1000); }
void OnGUI() { beginColumn(); if (GUILayout.Button("Start Flurry Session")) { // Optional information FlurryAnalytics.setAge(12); FlurryAnalytics.setGender("M"); // replace with your Flurry Key!!! FlurryAnalytics.startSession("XJHB5EGMQ9NCC6XWH43W"); } if (GUILayout.Button("Log Event")) { FlurryAnalytics.logEvent("Stuff Happened", false); } if (GUILayout.Button("Log Event with Params")) { var dict = new Dictionary <string, string>(); dict.Add("akey1", "value1"); dict.Add("bkey2", "value2"); dict.Add("ckey3", "value3"); dict.Add("dkey4", "value4"); FlurryAnalytics.logEventWithParameters("EventWithParams", dict, false); } if (GUILayout.Button("Log Timed Event")) { FlurryAnalytics.logEvent("Timed Event", true); } if (GUILayout.Button("End Timed Event")) { FlurryAnalytics.endTimedEvent("Timed Event"); } if (GUILayout.Button("Set Reports on Close")) { FlurryAnalytics.setSessionReportsOnCloseEnabled(true); } if (GUILayout.Button("Set Reports on Pause")) { FlurryAnalytics.setSessionReportsOnPauseEnabled(true); } endColumn(true); if (GUILayout.Button("Enable Ads")) { FlurryAds.enableAds(true); } if (GUILayout.Button("Fetch Ads")) { FlurryAds.fetchAdForSpace("adSpace", FlurryAdSize.Bottom); FlurryAds.fetchAdForSpace("splash", FlurryAdSize.Fullscreen); } if (GUILayout.Button("Check if Ad Available")) { var isAvailable = FlurryAds.isAdAvailableForSpace("adSpace", FlurryAdSize.Bottom); Debug.Log("is ad available: " + isAvailable); } if (GUILayout.Button("Show Ad on Bottom")) { FlurryAds.displayAdForSpace("adSpace", FlurryAdSize.Bottom); } if (GUILayout.Button("Fetch and Show Ad")) { FlurryAds.fetchAndDisplayAdForSpace("adSpace", FlurryAdSize.Top); } if (GUILayout.Button("Show Full Screen Ad")) { FlurryAds.fetchAndDisplayAdForSpace("splash", FlurryAdSize.Fullscreen); } if (GUILayout.Button("Remove Ad")) { FlurryAds.removeAdFromSpace("adSpace"); } endColumn(); }