public override bool?showBanner()
    {
        //Debug.Log("show flurry");
        try
        {
            base.showBanner();

            if (Info.IsEditor())
            {
                //Debug.Log("show return flurry");
                return(false);
            }
#if UNITY_ANDROID
            FlurryAndroid.checkIfAdIsAvailable(banner_id, placement, 2000);
            FlurryAndroid.displayAd(banner_id, placement, 0);
            return(null);
#elif UNITY_IPHONE
            if (!FlurryBinding.isAdAvailableForSpace(banner_id, placement))
            {
                //Debug.Log("show return 2 flurry");
                return(false);
            }
            FlurryBinding.displayAdForSpace(banner_id, placement);
            return(true);
#else
            return(false);
#endif
        }
        catch
        {
            return(Error(API, ERROR_TRY_SHOW_BANNER));
        }
    }
示例#2
0
//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 override bool?showInterstitial()
    {
        try
        {
            if (!Info.HasConnection())
            {
                return(false);
            }

            base.showInterstitial();

            if (Info.IsEditor() || Info.IsWeb() || (firstTime && !Setup()))
            {
                return(false);
            }

                        #if UNITY_ANDROID
            FlurryAndroid.checkIfAdIsAvailable(inters_id, FlurryAdPlacement.FullScreen, 2000);
            FlurryAndroid.displayAd(inters_id, FlurryAdPlacement.FullScreen, 0);
            return(null);
                        #elif UNITY_IPHONE
            if (!FlurryBinding.isAdAvailableForSpace(inters_id, FlurryAdSize.Fullscreen))
            {
                return(false);
            }

            FlurryBinding.fetchAndDisplayAdForSpace(inters_id, FlurryAdSize.Fullscreen);
            return(true);
                        #else
            return(false);
                        #endif
        }
        catch
        {
            return(Error(API, ERROR_TRY_SHOW_INTERSTITIAL));
        }
    }
    void OnGUI()
    {
        beginColumn();

        if (GUILayout.Button("Start Flurry Session"))
        {
            // replace with your Flurry app ID!!!
            FlurryAndroid.onStartSession("RPQYDGBDSQ7Z3DPM7XVU", true, true);
        }


        if (GUILayout.Button("Fetch Ads"))
        {
            FlurryAndroid.fetchAdsForSpace("space", FlurryAdPlacement.BannerBottom);
            FlurryAndroid.fetchAdsForSpace("bigAd", FlurryAdPlacement.FullScreen);
        }


        if (GUILayout.Button("Display Ad"))
        {
            FlurryAndroid.displayAd("space", FlurryAdPlacement.BannerBottom, 1000);
        }


        if (GUILayout.Button("Display bigAd Ad"))
        {
            FlurryAndroid.displayAd("bigAd", FlurryAdPlacement.FullScreen, 1000);
        }


        if (GUILayout.Button("Remove Ad"))
        {
            FlurryAndroid.removeAd("space");
        }


        endColumn(true);


        if (GUILayout.Button("Log Timed Event"))
        {
            FlurryAndroid.logEvent("timed", true);
        }


        if (GUILayout.Button("End Timed Event"))
        {
            FlurryAndroid.endTimedEvent("timed");
        }


        if (GUILayout.Button("Log Event"))
        {
            FlurryAndroid.logEvent("myFancyEvent");
        }


        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");

            FlurryAndroid.logEvent("EventWithParams", dict);
        }


        if (GUILayout.Button("Log Page View"))
        {
            FlurryAndroid.onPageView();
        }


        if (GUILayout.Button("Log Error"))
        {
            FlurryAndroid.onError("666", "bad things happend", "Exception");
        }

        endColumn();
    }