示例#1
0
        public void LogGenericAction(string action, Dictionary <string, object> messageDetails)
        {
            GenericWrapperAnalytics genericWrapperAnalytics = new GenericWrapperAnalytics(action, messageDetails);

            SwrveManager.Log("Logging GenericAction: " + genericWrapperAnalytics.ToString());
            this.GenericSendLogAction(genericWrapperAnalytics);
        }
示例#2
0
        public void LogGenericAction(string action)
        {
            GenericStringAnalytics genericStringAnalytics = new GenericStringAnalytics(action);

            SwrveManager.Log("Logging GenericAction: " + genericStringAnalytics.ToString());
            this.GenericSendLogAction(genericStringAnalytics);
        }
示例#3
0
 private void Awake()
 {
     if (SwrveManager.instance == null)
     {
         SwrveManager.instance = this;
         UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
         SwrveComponent swrveComponent = base.gameObject.AddComponent <SwrveComponent>();
         swrveComponent.InitialiseOnStart = false;
     }
     else if (SwrveManager.instance != this)
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
示例#4
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         Object.DontDestroyOnLoad(base.gameObject);
         SwrveComponent swrveComponent = base.gameObject.AddComponent <SwrveComponent>();
         customSwrveConfig = new SwrveConfig();
     }
     else if (instance != this)
     {
         Object.Destroy(base.gameObject);
     }
 }
示例#5
0
 public void InitWithAnalyticsKeySecret(int appId, string apiKey)
 {
     this.AnalyticsId  = appId.ToString();
     this.AnalyticsKey = apiKey;
     SwrveManager.Log("Init with appId " + this.AnalyticsId + " and apiKey: " + this.AnalyticsKey);
     SwrveComponent.Instance.Config.UseHttpsForEventsServer    = true;
     SwrveComponent.Instance.Config.UseHttpsForContentServer   = true;
     SwrveComponent.Instance.Config.SendEventsIfBufferTooLarge = true;
     SwrveComponent.Instance.Config.AutomaticSessionManagement = true;
     if (string.IsNullOrEmpty(SwrveComponent.Instance.Config.AppVersion))
     {
         SwrveComponent.Instance.Config.AppVersion = Application.version;
     }
     this.FinishSwrveSDKInit();
 }
示例#6
0
 public void RegisterPlayer(int appId, string apiKey, string playerId)
 {
     this.userId = playerId;
     SwrveComponent.Instance.Config.UserId = WWW.EscapeURL(this.userId);
     this.AnalyticsId  = appId.ToString();
     this.AnalyticsKey = apiKey;
     SwrveManager.Log(string.Concat(new object[]
     {
         "Init with appId ",
         appId,
         " and apiKey: ",
         apiKey
     }));
     SwrveComponent.Instance.Init(appId, apiKey);
     this.resourceManager = SwrveComponent.Instance.SDK.ResourceManager;
 }
示例#7
0
 private void RaiseAlert(string message)
 {
     SwrveManager.Log(message);
 }
示例#8
0
 public void LogAnalyticsAction(IAnalytics analytics)
 {
     SwrveManager.Log("Logging GenericAction: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#9
0
 public void LogFailedReceiptAction(FailedReceiptAnalytics analytics)
 {
     SwrveManager.Log("Logging FailedReceiptAction: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#10
0
 public void LogTestImpressionAction(TestImpressionAnalytics analytics)
 {
     SwrveManager.Log("Logging TestImpressionAction: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#11
0
 public void LogCurrencyGivenAction(CurrencyGivenAnalytics analytics)
 {
     SwrveManager.Log("Logging currency_given_custom: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#12
0
 public void LogPurchaseAction(PurchaseAnalytics analytics)
 {
     SwrveManager.Log("Logging purchase_custom: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#13
0
 public void LogIAPAction(IAPAnalytics analytics)
 {
     SwrveManager.Log("Logging IAP_custom: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#14
0
 public void LogNavigationAction(NavigationActionAnalytics analytics)
 {
     SwrveManager.Log("Logging NavigationAction: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#15
0
 public void LogFunnelAction(FunnelStepsAnalytics analytics)
 {
     SwrveManager.Log("Logging FunnelAction: " + analytics.ToString());
     this.GenericSendLogAction(analytics);
 }
示例#16
0
        private void FinishSwrveSDKInit()
        {
            SwrveComponent.Instance.Init(int.Parse(this.AnalyticsId), this.AnalyticsKey);
            SwrveConfig config = SwrveComponent.Instance.Config;

            if (config.AndroidPushProvider == AndroidPushProvider.GOOGLE_GCM && config.PushNotificationEnabled && !string.IsNullOrEmpty(config.GCMSenderId))
            {
                SwrveManagerUtils.RegisterGCMDevice(SwrveComponent.Instance.name, config.GCMSenderId, config.GCMPushNotificationTitle, config.GCMPushNotificationIconId, config.GCMPushNotificationMaterialIconId, config.GCMPushNotificationLargeIconId, config.GCMPushNotificationAccentColor, config.GCMSenderId.ToLower() + "Group");
            }
            Dictionary <string, string> deviceInfo = SwrveComponent.Instance.SDK.GetDeviceInfo();
            string text   = deviceInfo["swrve.device_name"];
            string value  = deviceInfo["swrve.os"];
            string value2 = deviceInfo["swrve.device_dpi"];
            string value3 = deviceInfo["swrve.device_width"];
            string value4 = deviceInfo["swrve.device_height"];
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("device_name", text);
            dictionary.Add("os", value);
            dictionary.Add("device_dpi", value2);
            dictionary.Add("device_width", value3);
            dictionary.Add("device_height", value4);
            if (!string.IsNullOrEmpty(SwrveComponent.Instance.Config.UserId))
            {
                dictionary.Add("swrve_user_id", SwrveComponent.Instance.Config.UserId);
            }
            else
            {
                SwrveManager.Log("### !!! unable to add userId to the userProps");
            }
            dictionary.Add("jailbroken.is_jailbroken", SwrveManagerUtils.GetIsJailBroken());
            dictionary.Add("lat.is_lat", SwrveManagerUtils.GetIsLat().ToString());
            string text2 = string.Empty;

            if (Application.platform == RuntimePlatform.Android)
            {
                text2 = "gida";
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                text2 = "idfa";
            }
            if (SwrveManagerUtils.IsAndiAvailable() && SwrveManagerUtils.IsAndiInitialized())
            {
                string text3 = (string)SwrveManagerUtils.ANDIType.GetMethod("GetAndiu").Invoke(null, null);
                SwrveManager.Log("### Let's send Swrve the andiu: " + text3);
                dictionary.Add("andiu", text3);
            }
            string text4 = SwrveManagerUtils.AESEncrypt(text, SwrveManagerUtils.GetAdvertiserID());

            SwrveManager.Log("### encryptedAdvertiserId: " + text4);
            if (!string.IsNullOrEmpty(text2))
            {
                dictionary.Add(text2, text4);
            }
            string rSAEncryptedKey = SwrveManagerUtils.GetRSAEncryptedKey();

            SwrveManager.Log("### eskKey: " + rSAEncryptedKey);
            if (!string.IsNullOrEmpty(rSAEncryptedKey))
            {
                dictionary.Add("esk", rSAEncryptedKey);
            }
            if (this.customUserData != null)
            {
                foreach (KeyValuePair <string, string> current in this.customUserData)
                {
                    if (!dictionary.ContainsKey(current.Key))
                    {
                        dictionary.Add(current.Key, current.Value);
                    }
                    else
                    {
                        SwrveManager.Log("###Duplicate KEY!! unable to add " + current.Key + " - " + current.Value);
                    }
                }
            }
            SwrveComponent.Instance.SDK.UserUpdate(dictionary);
            this.resourceManager = SwrveComponent.Instance.SDK.ResourceManager;
        }