Exemplo n.º 1
0
    public static void SetAppVersion(string version)
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        FlurryAndroid.SetAppVersion(version);
#elif UNITY_IOS
        FlurryIOS.SetAppVersion(version);
#endif
    }
Exemplo n.º 2
0
    public static void SetUserId(string userId)
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        FlurryAndroid.SetUserId(userId);
#elif UNITY_IOS
        FlurryIOS.SetUserId(userId);
#endif
    }
Exemplo n.º 3
0
    public static void Init(string apiKey)
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        FlurryAndroid.Init(apiKey);
#elif UNITY_IOS
        FlurryIOS.Init(apiKey);
#endif
    }
Exemplo n.º 4
0
    public static void LogEvent(string eventName)
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        FlurryAndroid.LogEvent(eventName);
#elif UNITY_IOS
        FlurryIOS.LogEvent(eventName);
#endif
    }
Exemplo n.º 5
0
    public static void LogEvent(string eventName, Dictionary <string, string> parameters)
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        FlurryAndroid.LogEvent(eventName, parameters);
#elif UNITY_IOS
        FlurryIOS.LogEvent(eventName, parameters);
#endif
    }
Exemplo n.º 6
0
    public static void SetLogEnabled(bool isEnabled)
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        FlurryAndroid.SetLogEnabled(isEnabled);
#elif UNITY_IOS
        FlurryIOS.SetLogEnabled(isEnabled);
#endif
    }
Exemplo n.º 7
0
    void Start()
    {
#if UNITY_ANDROID
        FlurryAndroid.onStartSession("JTR3SGZZ9C2439G956Q7", true, testAds);
#endif
#if UNITY_IOS
        FlurryAnalytics.startSession("H8QFPTXMM9NH2W3QVWX4");
#endif
    }
    private void Initialize()
    {
        service = Flurry.Instance;

        //AssertNotNull(service, "Unable to create Flurry instance!", this);
        //Assert(!string.IsNullOrEmpty(_iosApiKey), "_iosApiKey is empty!", this);
        //Assert(!string.IsNullOrEmpty(_androidApiKey), "_androidApiKey is empty!", this);

        FlurryAndroid.SetLogEnabled(true);
        service.StartSession(ConfigManager.FLURRY_IOS_KEY, ConfigManager.FLURRY_ANDROID_KEY);
    }
Exemplo n.º 9
0
    /// <summary>
    /// Create Flurry singleton instance and log single event.
    /// </summary>
    private void Awake()
    {
        IAnalytics service = Flurry.Instance;

        AssertNotNull(service, "Unable to create Flurry instance!", this);
        Assert(!string.IsNullOrEmpty(_iosApiKey), "_iosApiKey is empty!", this);
        Assert(!string.IsNullOrEmpty(_androidApiKey), "_androidApiKey is empty!", this);

        FlurryAndroid.SetLogEnabled(true);
        service.StartSession(_iosApiKey, _androidApiKey);
    }
Exemplo n.º 10
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
    }
Exemplo n.º 11
0
    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
        }
    }
Exemplo n.º 12
0
        private AnalyticsManager()
        {
            // For Flurry Android only:
            FlurryAndroid.SetLogEnabled(true);

            // For Flurry iOS only:
            FlurryIOS.SetDebugLogEnabled(true);
            flurryAnalytics = Flurry.Flurry.Instance;
            flurryAnalytics.StartSession(SGConfig.Instant.GetStringValue(FLURRY_KEY, ""));
            flurryAnalytics.LogUserID("Github User");
            flurryAnalytics.LogEvent("event", new Dictionary <string, string> {
                { "platform", "Github" }
            });
        }
Exemplo n.º 13
0
    private void Awake()
    {
        // For Flurry Android only:
        FlurryAndroid.SetLogEnabled(false);

        // For Flurry iOS only:
        FlurryIOS.SetDebugLogEnabled(false);

        IAnalytics service = Flurry.Flurry.Instance;

        service.StartSession(_iosApiKey, _androidApiKey);

        service.LogUserID(GameSparksManager.UserID());
    }
    // Use this for initialization
    void Start()
    {
        _scrollSnap = GameObjectHelper.GetChildComponentOnNamedGameObject <HorizontalScrollSnap>(gameObject, "ScrollView", true);
        _nextButton = GameObjectHelper.GetChildNamedGameObject(gameObject, "NextButton", true);

        container = gameObject;

        //

        AddBanner();

        GameManager.SafeAddListener <BannerLoadedMessage>(BannerLoadedHandler);
        GameManager.SafeAddListener <VideoAdShowingMessage>(VideoAdShowingHandler);

        StartCoroutine(CoRoutines.DelayedCallback(0.5f, BonusCoins));

        ((CustomGameManager)GameManager.Instance).ResetDefaultSound();

        if (!Debug.isDebugBuild)
        {
            FlurryIOS.LogPageView();
            FlurryAndroid.OnPageView();

            Fabric.Answers.Answers.LogContentView("Levels", "Screen");
        }

        _rankSignGameObject  = GameObjectHelper.GetChildNamedGameObject(packsContainer, "Sign", true);
        _rankSignText        = GameObjectHelper.GetChildComponentOnNamedGameObject <Text>(_rankSignGameObject, "RankName", true);
        _ranksVerticalScroll = GameObjectHelper.GetChildComponentOnNamedGameObject <CustomVerticalScrollSnap>(packsContainer, "ScrollView", true);

        PrepareRankForLevel(GameManager.Instance.Levels.Selected);

        _ranksVerticalScroll.StartingScreen = LevelController.Ranks().Items.Length - (_currentRank.Number - 1) - 1;

        if (PreferencesFactory.GetInt(Constants.KeyShowSelectedPack) > 0 &&
            GameManager.Instance.Levels.Selected != null)
        {
            PreferencesFactory.DeleteKey(Constants.KeyShowSelectedPack);

            GoToLevel(GameManager.Instance.Levels.Selected);
        }

#if !UNITY_EDITOR
        AdColonyManager.Instance.RequestAd(); // request ads to cache for CustomLevelButton.cs
#endif
    }
Exemplo n.º 15
0
    // NOTE:
    // only for Android
    // @param productName The name of the product purchased.
    // @param productId The id of the product purchased.
    // @param quantity The number of products purchased.
    // @param price The price of the the products purchased in the given currency.
    // @param currency The currency for the price argument.
    // @param transactionId A unique identifier for the transaction used to make the purchase.
    // @param parameters A {@code Map<String, String>} of the parameters which should be submitted with this event.
    // @example: logPayment("candy", "yummy_candy", 1, 2.99, "USD", "123456789", params)
    public static void LogPayment(string productName, string productId, int quantity, double price,
                                  string currency, string transactionId = null, Dictionary <string, string> parameters = null)
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        if (string.IsNullOrEmpty(transactionId))
        {
            transactionId = System.DateTime.Now.ToString("yyyyMMddTHHmmss");
        }
        if (parameters == null)
        {
            parameters = new Dictionary <string, string>();
        }

        FlurryAndroid.LogPayment(productName, productId, quantity, price, currency, transactionId, parameters);
#elif UNITY_IOS
#endif
    }
Exemplo n.º 16
0
 public override void hideBanner()
 {
     //Debug.Log("hide flurry");
     try
     {
         if (Info.IsEditor())
         {
             //Debug.Log("return flurry");
             return;
         }
                     #if UNITY_ANDROID
         FlurryAndroid.removeAd(banner_id);
                     #elif UNITY_IPHONE
         FlurryBinding.removeAdFromSpace(banner_id);
                     #endif
     }
     catch
     {
         Error(API, ERROR_TRY_HIDE_BANNER);
     }
 }
Exemplo n.º 17
0
    public override void fetchBanner(AdvertisementManager.Positions pos)
    {
        try
        {
            base.fetchBanner(pos);

            if (Info.IsEditor())
            {
                return;
            }

                        #if UNITY_ANDROID
            if (pos == AdvertisementManager.Positions.BOTTOM)
            {
                placement = FlurryAdPlacement.BannerBottom;
            }
            else
            {
                placement = FlurryAdPlacement.BannerTop;
            }

            FlurryAndroid.fetchAdsForSpace(banner_id, placement);
                        #elif UNITY_IPHONE
            if (pos == AdvertisementManager.Positions.BOTTOM)
            {
                placement = FlurryAdSize.Bottom;
            }
            else
            {
                placement = FlurryAdSize.Top;
            }

            FlurryBinding.fetchAdForSpace(banner_id, placement);
                        #endif
        }
        catch
        {
            Error(API, ERROR_LOADING_BANNER);
        }
    }
Exemplo n.º 18
0
    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));
        }
    }
Exemplo n.º 19
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
    }
Exemplo n.º 20
0
 public void EndLogEvent(string eventName, Dictionary <string, string> parameters)
 {
     FlurryAndroid.EndTimedEvent(eventName, parameters);
 }
Exemplo n.º 21
0
    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();
    }
    // Use this for initialization
    void Start()
    {
        Branch.initSession(CallbackWithBranchUniversalObject);

        int show = PreferencesFactory.GetInt(Constants.KeyShowBannerOnMainMenuScreen, 0);

        container = GameObject.Find("Container");

        if (PreferencesFactory.GetInt(Constants.KeyNoAds, 0) == 1)
        {
            show = 0; // disable ads
        }

        _rewardShareButton = GameObjectHelper.GetChildNamedGameObject(gameObject, "RewardButton", true);

        if (_rewardShareButton != null && RewardsShareHelper.WillReward())
        {
            ShowRewardShareButton();
        }

        #if !UNITY_EDITOR
        // delay request until AdColony is configured
        StartCoroutine(CoRoutines.DelayedCallback(1.5f, () =>
        {
            AdColonyManager.Instance.RequestAd();
        }));
        #endif

        if (show > 0)             // show banner only when return to main screen, not cold start
        {
            AddBanner();
            PreferencesFactory.DeleteKey(Constants.KeyShowBannerOnMainMenuScreen);

            int CountClicks = PreferencesFactory.GetInt(Constants.KeyCountMainMenuClicks);
            PreferencesFactory.SetInt(Constants.KeyCountMainMenuClicks, CountClicks + 1);

            //         if (CountClicks > 0 && CountClicks % Constants.ShowAdsPerTime == 0 && Reachability.Instance.IsReachable ()) {
            //	Loading.Instance.Show ();

            //	AdColonyManager.Instance.SetCallback (BannerMainMenuClosed);
            //             AdColonyManager.Instance.PlayAd(AdColonyManager.Instance.AdForZoneId());
            //}
        }
        else             // show banner on cold start
        {
            ColdStart = true;

            int CountMainMenuColdStart = PreferencesFactory.GetInt(Constants.KeyCountMainMenuColdStart);
            PreferencesFactory.SetInt(Constants.KeyCountMainMenuColdStart, CountMainMenuColdStart + 1);
        }

        GameManager.SafeAddListener <BannerLoadedMessage> (BannerLoadedHandler);
        GameManager.SafeAddListener <VideoAdShowingMessage> (VideoAdShowingHandler);

        ((CustomGameManager)GameManager.Instance).ResetDefaultSound();

        if (!Debug.isDebugBuild)
        {
            FlurryIOS.LogPageView();
            FlurryAndroid.OnPageView();

            Fabric.Answers.Answers.LogContentView("Menu", "Screen");
        }

        StartCoroutine(CoRoutines.DelayedCallback(0.5f, () =>
        {
            CheckForPrize();
        }));

        GameSparksManager.Instance.SetGameMode(GameMode.Single);

        AnimatePig();
    }
Exemplo n.º 23
0
 protected override void OnDestroy()
 {
     EndSession();
     FlurryAndroid.Dispose();
     base.OnDestroy();
 }
Exemplo n.º 24
0
 /// <summary>
 /// 初始化Flurry
 /// </summary>
 public void FlurryInit( )
 {
     FlurryAndroid.SetLogEnabled(true);
     StartSession("", "62PW8WPH9836DPPJ96VP");
 }
Exemplo n.º 25
0
 public EventRecordStatus BeginLogEvent(string eventName, Dictionary <string, string> parameters)
 {
     return(FlurryAndroid.LogEvent(eventName, parameters, true));
 }
Exemplo n.º 26
0
 public void LogUserGender(UserGender gender)
 {
     FlurryAndroid.SetGender((byte)(gender == UserGender.Male ? 1 : gender == UserGender.Female ? 0 : -1));
 }
Exemplo n.º 27
0
 public void LogError(string errorID, string message, object target)
 {
     FlurryAndroid.OnError(errorID, message, target.GetType().Name);
 }
Exemplo n.º 28
0
 public void LogUserID(string userID)
 {
     FlurryAndroid.SetUserId(userID);
 }
Exemplo n.º 29
0
 public void EndLogEvent(string eventName)
 {
     FlurryAndroid.EndTimedEvent(eventName);
 }
Exemplo n.º 30
0
 public void LogUserAge(int age)
 {
     FlurryAndroid.SetAge(age);
 }