Esempio n. 1
0
    // Inicializa a classe Flurry
    // Essa classe só é instanciada automaticamente pela Advertisement (se o Flurry for solicitado)
    // Necessario enviar a Key do Flurry ao instanciar
    public static void Start(string key)
    {
        // Se não for mobile (ex: Web), retornar
#if UNITY_WEBPLAYER
        return;
#endif

        // Instancia prefab correta para as diferentes plataformas
                #if UNITY_IPHONE
        Initializate.AddPrefab("FlurryManager", typeof(FlurryManager));

        if (!Info.IsEditor())
        {
            FlurryBinding.startSession(key);
        }
                #elif UNITY_ANDROID
        Initializate.AddPrefab("FlurryAndroidManager", typeof(FlurryAndroidManager));

        if (!Info.IsEditor())
        {
            FlurryAndroid.onStartSession(key, true, true, false);
        }
                #endif
    }
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();
    }
    // Use this for initialization
    void Awake()
    {
        //Set Static flags
        ChartBoostActiveStaticFlag = ChartBoostActiveFlag;
        RevMobActiveStaticFlag     = RevMobActiveFlag;
        AdMobActiveStaticFlag      = AdMobActiveFlag;
        PlayHavenActiveStaticFlag  = PlayHavenActiveFlag;
        IAdsActiveStaticFlag       = IAdsActiveFlag;
        TapJoyActiveStaticFlag     = TapJoyActiveFlag;
        VungleActiveStaticFlag     = VungleActiveFlag;
        FlurryActiveStaticFlag     = FlurryActiveFlag;
        AppLovinStaticFlag         = AppLovinFlag;

        //Initialize ChartBoost
        if (ChartBoostActiveFlag)
        {
            ChartBoostBinding.init(ChartBoostID, ChartBoostSIG, false);
            ChartBoostBinding.cacheInterstitial(null);
            ChartBoostBinding.cacheMoreApps();
        }

        //Initialize RevMob
        if (RevMobActiveFlag)
        {
            REVMOB_APP_IDS.Add("IOS", RevMobID);
            revMobSession = RevMob.Start(REVMOB_APP_IDS);
        }

        //Initialize Admob
        if (AdMobActiveFlag)
        {
            AdMobBinding.init(AdMobID);
        }

        //Initialize Playhaven
        if (PlayHavenActiveFlag)
        {
            gameObject.SendMessage("OpenNotification");
        }

        //Initialize iAds
        if (IAdsActiveFlag)
        {
        }

        //Initialize TapJoy
        if (TapJoyActiveFlag)
        {
            TapjoyPluginIOS.RequestTapjoyConnect(TapJoyID, TapJoySecretKey);
            Debug.Log("Tapjoy integrated");
        }

        //Initialize Vungle
        if (VungleActiveFlag)
        {
            VungleBinding.startWithAppId(VungleID);
        }

        //Initialize Flurry
        if (FlurryActiveFlag)
        {
            FlurryBinding.startSession(FlurryID);
            //FlurryBinding.logEvent("Testing session started", false);
        }

        if (AppLovinFlag)
        {
            AppLovin.SetSdkKey(AppLovinID);
            AppLovin.InitializeSdk();
        }
    }