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));
        }
    }
Esempio n. 2
0
    void OnGUI()
    {
        beginColumn();

        if (GUILayout.Button("Start Flurry Session"))
        {
            // Optional information
            FlurryBinding.setAge(12);
            FlurryBinding.setGender("M");

            // replace with your Flurry Key!!!
            FlurryBinding.startSession("XJHB5EGMQ9NCC6XWH43W");
        }


        if (GUILayout.Button("Log Event"))
        {
            FlurryBinding.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");

            FlurryBinding.logEventWithParameters("EventWithParams", dict, false);
        }


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


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


        if (GUILayout.Button("Set Reports on Close"))
        {
            FlurryBinding.setSessionReportsOnCloseEnabled(true);
        }


        if (GUILayout.Button("Set Reports on Pause"))
        {
            FlurryBinding.setSessionReportsOnPauseEnabled(true);
        }


        endColumn(true);


        if (GUILayout.Button("Enable Ads"))
        {
            FlurryBinding.enableAds(true);
        }


        if (GUILayout.Button("Fetch Ads"))
        {
            FlurryBinding.fetchAdForSpace("adSpace", FlurryAdSize.Bottom);
            FlurryBinding.fetchAdForSpace("splash", FlurryAdSize.Fullscreen);
        }


        if (GUILayout.Button("Check if Ad Available"))
        {
            var isAvailable = FlurryBinding.isAdAvailableForSpace("adSpace", FlurryAdSize.Bottom);
            Debug.Log("is ad available: " + isAvailable);
        }


        if (GUILayout.Button("Show Ad on Bottom"))
        {
            FlurryBinding.displayAdForSpace("adSpace", FlurryAdSize.Bottom);
        }


        if (GUILayout.Button("Fetch and Show Ad"))
        {
            FlurryBinding.fetchAndDisplayAdForSpace("adSpace", FlurryAdSize.Top);
        }


        if (GUILayout.Button("Show Full Screen Ad"))
        {
            FlurryBinding.fetchAndDisplayAdForSpace("splash", FlurryAdSize.Fullscreen);
        }


        if (GUILayout.Button("Remove Ad"))
        {
            FlurryBinding.removeAdFromSpace("adSpace");
        }

        endColumn();
    }