public void LogInvite(string method, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("InviteEvent", customAttributes);

            answersEventInstanceJavaObject.PutMethod(method);
            answersSharedInstance.Log("logInvite", answersEventInstanceJavaObject);
        }
Esempio n. 2
0
        public void LogSearch(string query, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject eventInstance = new AnswersEventInstanceJavaObject("SearchEvent", customAttributes, new string[0]);

            eventInstance.InvokeSafelyAsString("putQuery", query);
            this.answersSharedInstance.Log("logSearch", eventInstance);
        }
Esempio n. 3
0
        public void LogInvite(string method, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject eventInstance = new AnswersEventInstanceJavaObject("InviteEvent", customAttributes, new string[0]);

            eventInstance.PutMethod(method);
            this.answersSharedInstance.Log("logInvite", eventInstance);
        }
        public void LogLevelStart(string level, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("LevelStartEvent", customAttributes);

            answersEventInstanceJavaObject.InvokeSafelyAsString("putLevelName", level);
            answersSharedInstance.Log("logLevelStart", answersEventInstanceJavaObject);
        }
        public void LogSearch(string query, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("SearchEvent", customAttributes);

            answersEventInstanceJavaObject.InvokeSafelyAsString("putQuery", query);
            answersSharedInstance.Log("logSearch", answersEventInstanceJavaObject);
        }
		public void LogLogin (string method, bool? success, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("LoginEvent", customAttributes);
			eventInstance.PutMethod (method);
			eventInstance.PutSuccess (success);
			answersSharedInstance.Log ("logLogin", eventInstance);
		}
 public void Log(string methodName, AnswersEventInstanceJavaObject eventInstance)
 {
     this.javaObject.Call(methodName, new object[1]
     {
         (object)eventInstance.javaObject
     });
 }
 public AnswersEventInstanceJavaObject(string eventType, Dictionary <string, object> customAttributes, params string[] args)
 {
     this.javaObject = new AndroidJavaObject(string.Format("com.crashlytics.android.answers.{0}", eventType), args);
     foreach (KeyValuePair <string, object> keyValuePair in customAttributes)
     {
         string key   = keyValuePair.Key;
         object value = keyValuePair.Value;
         if (value == null)
         {
             UnityEngine.Debug.Log(string.Format("[Answers] Expected custom attribute value to be non-null. Received: {0}", value));
         }
         else if (AnswersEventInstanceJavaObject.IsNumericType(value))
         {
             this.javaObject.Call <AndroidJavaObject>("putCustomAttribute", new object[]
             {
                 key,
                 AnswersEventInstanceJavaObject.AsDouble(value)
             });
         }
         else if (value is string)
         {
             this.javaObject.Call <AndroidJavaObject>("putCustomAttribute", new object[]
             {
                 key,
                 value
             });
         }
         else
         {
             UnityEngine.Debug.Log(string.Format("[Answers] Expected custom attribute value to be a string or numeric. Received: {0}", value));
         }
     }
 }
        public void LogLogin(string method, bool?success, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("LoginEvent", customAttributes);

            answersEventInstanceJavaObject.PutMethod(method);
            answersEventInstanceJavaObject.PutSuccess(success);
            answersSharedInstance.Log("logLogin", answersEventInstanceJavaObject);
        }
        public void LogSignUp(string method, bool?success, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("SignUpEvent", customAttributes, new string[0]);

            answersEventInstanceJavaObject.PutMethod(method);
            answersEventInstanceJavaObject.PutSuccess(success);
            this.answersSharedInstance.Log("logSignUp", answersEventInstanceJavaObject);
        }
Esempio n. 11
0
        public void LogLogin(string method, bool?success, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject eventInstance = new AnswersEventInstanceJavaObject("LoginEvent", customAttributes, new string[0]);

            eventInstance.PutMethod(method);
            eventInstance.PutSuccess(success);
            this.answersSharedInstance.Log("logLogin", eventInstance);
        }
		public void LogLevelEnd (string level, double? score, bool? success, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("LevelEndEvent", customAttributes);			
			eventInstance.InvokeSafelyAsString ("putLevelName", level);
			eventInstance.InvokeSafelyAsDouble ("putScore", score);
			eventInstance.PutSuccess (success);
			answersSharedInstance.Log ("logLevelEnd", eventInstance);
		}
        public void LogSignUp(string method, bool?success, Dictionary <string, object> customAttributes)
        {
            var eventInstance = new AnswersEventInstanceJavaObject("SignUpEvent", customAttributes);

            eventInstance.PutMethod(method);
            eventInstance.PutSuccess(success);
            answersSharedInstance.Log("logSignUp", eventInstance);
        }
        public void LogContentView(string contentName, string contentType, string contentId, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("ContentViewEvent", customAttributes);

            answersEventInstanceJavaObject.PutContentName(contentName);
            answersEventInstanceJavaObject.PutContentType(contentType);
            answersEventInstanceJavaObject.PutContentId(contentId);
            answersSharedInstance.Log("logContentView", answersEventInstanceJavaObject);
        }
        public void LogLevelEnd(string level, double?score, bool?success, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("LevelEndEvent", customAttributes);

            answersEventInstanceJavaObject.InvokeSafelyAsString("putLevelName", level);
            answersEventInstanceJavaObject.InvokeSafelyAsDouble("putScore", score);
            answersEventInstanceJavaObject.PutSuccess(success);
            answersSharedInstance.Log("logLevelEnd", answersEventInstanceJavaObject);
        }
        public void LogCustom(string eventName, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject eventInstance = new AnswersEventInstanceJavaObject("CustomEvent", customAttributes, new string[]
            {
                eventName
            });

            this.answersSharedInstance.Log("logCustom", eventInstance);
        }
        public void LogStartCheckout(decimal?totalPrice, string currency, int?itemCount, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("StartCheckoutEvent", customAttributes);

            answersEventInstanceJavaObject.InvokeSafelyAsDecimal("putTotalPrice", totalPrice);
            answersEventInstanceJavaObject.PutCurrency(currency);
            answersEventInstanceJavaObject.InvokeSafelyAsInt("putItemCount", itemCount);
            answersSharedInstance.Log("logStartCheckout", answersEventInstanceJavaObject);
        }
Esempio n. 18
0
        public void LogContentView(string contentName, string contentType, string contentId, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject eventInstance = new AnswersEventInstanceJavaObject("ContentViewEvent", customAttributes, new string[0]);

            eventInstance.PutContentName(contentName);
            eventInstance.PutContentType(contentType);
            eventInstance.PutContentId(contentId);
            this.answersSharedInstance.Log("logContentView", eventInstance);
        }
        public void LogRating(int?rating, string contentName, string contentType, string contentId, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("RatingEvent", customAttributes);

            answersEventInstanceJavaObject.InvokeSafelyAsInt("putRating", rating);
            answersEventInstanceJavaObject.PutContentName(contentName);
            answersEventInstanceJavaObject.PutContentType(contentType);
            answersEventInstanceJavaObject.PutContentId(contentId);
            answersSharedInstance.Log("logRating", answersEventInstanceJavaObject);
        }
		public void LogAddToCart (decimal? itemPrice, string currency, string itemName, string itemType, string itemId, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("AddToCartEvent", customAttributes);			
			eventInstance.InvokeSafelyAsDecimal ("putItemPrice", itemPrice);
			eventInstance.PutCurrency (currency);
			eventInstance.InvokeSafelyAsString ("putItemName", itemName);
			eventInstance.InvokeSafelyAsString ("putItemId", itemId);
			eventInstance.InvokeSafelyAsString ("putItemType", itemType);
			answersSharedInstance.Log ("logAddToCart", eventInstance);
		}
        public void LogShare(string method, string contentName, string contentType, string contentId, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("ShareEvent", customAttributes, new string[0]);

            answersEventInstanceJavaObject.PutMethod(method);
            answersEventInstanceJavaObject.PutContentName(contentName);
            answersEventInstanceJavaObject.PutContentType(contentType);
            answersEventInstanceJavaObject.PutContentId(contentId);
            this.answersSharedInstance.Log("logShare", answersEventInstanceJavaObject);
        }
 public void InvokeSafelyAsDouble(string methodName, object arg)
 {
     if (arg != null)
     {
         this.javaObject.Call <AndroidJavaObject>(methodName, new object[]
         {
             AnswersEventInstanceJavaObject.AsDouble(arg)
         });
     }
 }
        public void LogAddToCart(decimal?itemPrice, string currency, string itemName, string itemType, string itemId, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("AddToCartEvent", customAttributes);

            answersEventInstanceJavaObject.InvokeSafelyAsDecimal("putItemPrice", itemPrice);
            answersEventInstanceJavaObject.PutCurrency(currency);
            answersEventInstanceJavaObject.InvokeSafelyAsString("putItemName", itemName);
            answersEventInstanceJavaObject.InvokeSafelyAsString("putItemId", itemId);
            answersEventInstanceJavaObject.InvokeSafelyAsString("putItemType", itemType);
            answersSharedInstance.Log("logAddToCart", answersEventInstanceJavaObject);
        }
		public void LogShare (string method, string contentName, string contentType, string contentId, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("ShareEvent", customAttributes);
			
			eventInstance.PutMethod (method);
			eventInstance.PutContentName (contentName);
			eventInstance.PutContentType (contentType);
			eventInstance.PutContentId (contentId);
			
			answersSharedInstance.Log ("logShare", eventInstance);
		}
        public void LogPurchase(decimal?price, string currency, bool?success, string itemName, string itemType, string itemId, Dictionary <string, object> customAttributes)
        {
            AnswersEventInstanceJavaObject answersEventInstanceJavaObject = new AnswersEventInstanceJavaObject("PurchaseEvent", customAttributes);

            answersEventInstanceJavaObject.InvokeSafelyAsDecimal("putItemPrice", price);
            answersEventInstanceJavaObject.PutCurrency(currency);
            answersEventInstanceJavaObject.PutSuccess(success);
            answersEventInstanceJavaObject.InvokeSafelyAsString("putItemName", itemName);
            answersEventInstanceJavaObject.InvokeSafelyAsString("putItemId", itemId);
            answersEventInstanceJavaObject.InvokeSafelyAsString("putItemType", itemType);
            answersSharedInstance.Log("logPurchase", answersEventInstanceJavaObject);
        }
		public void LogPurchase (decimal? price, string currency, bool? success, string itemName, string itemType, string itemId, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("PurchaseEvent", customAttributes);
			
			eventInstance.InvokeSafelyAsDecimal ("putItemPrice", price);
			eventInstance.PutCurrency (currency);
			eventInstance.PutSuccess (success);
			eventInstance.InvokeSafelyAsString ("putItemName", itemName);
			eventInstance.InvokeSafelyAsString ("putItemId", itemId);
			eventInstance.InvokeSafelyAsString ("putItemType", itemType);
			answersSharedInstance.Log ("logPurchase", eventInstance);
		}
Esempio n. 27
0
 public AnswersEventInstanceJavaObject(string eventType, Dictionary <string, object> customAttributes, params string[] args)
 {
     this.javaObject = new AndroidJavaObject(string.Format("com.crashlytics.android.answers.{0}", (object)eventType), (object[])args);
     using (Dictionary <string, object> .Enumerator enumerator = customAttributes.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             KeyValuePair <string, object> current = enumerator.Current;
             string key = current.Key;
             object o   = current.Value;
             if (o == null)
             {
                 Debug.Log((object)string.Format("[Answers] Expected custom attribute value to be non-null. Received: {0}", o));
             }
             else if (AnswersEventInstanceJavaObject.IsNumericType(o))
             {
                 this.javaObject.Call <AndroidJavaObject>("putCustomAttribute", new object[2]
                 {
                     (object)key,
                     (object)AnswersEventInstanceJavaObject.AsDouble(o)
                 });
             }
             else if (o is string)
             {
                 this.javaObject.Call <AndroidJavaObject>("putCustomAttribute", new object[2]
                 {
                     (object)key,
                     o
                 });
             }
             else
             {
                 Debug.Log((object)string.Format("[Answers] Expected custom attribute value to be a string or numeric. Received: {0}", o));
             }
         }
     }
 }
		public void LogRating (int? rating, string contentName, string contentType, string contentId, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("RatingEvent", customAttributes);			
			
			eventInstance.InvokeSafelyAsInt ("putRating", rating);
			eventInstance.PutContentName (contentName);
			eventInstance.PutContentType (contentType);
			eventInstance.PutContentId (contentId);
			answersSharedInstance.Log ("logRating", eventInstance);
		}
		public void Log (string methodName, AnswersEventInstanceJavaObject eventInstance)
		{
			javaObject.Call (methodName, eventInstance.javaObject);
		}
		public void LogCustom (string eventName, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("CustomEvent", customAttributes, eventName);		
			answersSharedInstance.Log ("logCustom", eventInstance);
		}
		public void LogInvite (string method, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("InviteEvent", customAttributes);
			eventInstance.PutMethod (method);
			answersSharedInstance.Log ("logInvite", eventInstance);
		}
		public void LogLevelStart (string level, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("LevelStartEvent", customAttributes);
			eventInstance.InvokeSafelyAsString ("putLevelName", level);
			answersSharedInstance.Log ("logLevelStart", eventInstance);
		}
		public void LogStartCheckout (decimal? totalPrice, string currency, int? itemCount, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("StartCheckoutEvent", customAttributes);			
			eventInstance.InvokeSafelyAsDecimal ("putTotalPrice", totalPrice);
			eventInstance.PutCurrency (currency);
			eventInstance.InvokeSafelyAsInt ("putItemCount", itemCount);
			answersSharedInstance.Log ("logStartCheckout", eventInstance);
		}
		public void LogSearch (string query, Dictionary<string, object> customAttributes)
		{
			var eventInstance = new AnswersEventInstanceJavaObject ("SearchEvent", customAttributes);			
			eventInstance.InvokeSafelyAsString ("putQuery", query);
			answersSharedInstance.Log ("logSearch", eventInstance);
		}
 public void Log(string methodName, AnswersEventInstanceJavaObject eventInstance)
 {
     javaObject.Call(methodName, eventInstance.javaObject);
 }