Beispiel #1
0
 public static void TrackLevel(int level)
 {
     AppmetrPlatformPlugin.AttachProperties(new Dictionary <string, object>
     {
         { "$level", level }
     });
 }
Beispiel #2
0
 public static void TrackLevel(int level, IDictionary <string, object> properties)
 {
     if (properties == null)
     {
         properties = new Dictionary <string, object>();
     }
     properties.Add("$level", level);
     AppmetrPlatformPlugin.AttachProperties(properties);
 }
Beispiel #3
0
 /// <summary>
 /// Set application status.
 /// </summary>
 /// <param name="pause">
 /// Application status. True - if application paused and false otherwise
 /// </param>
 public static void OnPause(bool pause)
 {
     if (pause)
     {
         AppmetrPlatformPlugin.OnPause();
     }
     else
     {
         AppmetrPlatformPlugin.OnResume();
     }
 }
Beispiel #4
0
 /// <summary>
 /// Method for attaching properties to separate entity instead of user
 /// </summary>
 /// <param name='entityName'>
 /// Name of entity to attach.
 /// </param>
 /// <param name='entityValue'>
 /// Identity value of entity.
 /// </param>
 /// <param name='properties'>
 /// Attributes to attach.
 /// </param>
 public static void AttachEntityAttributes(string entityName, string entityValue, IDictionary <string, object> properties)
 {
     if (string.IsNullOrEmpty(entityName) || string.IsNullOrEmpty(entityValue))
     {
         Debug.LogError("AttachEntityAttributes has empty entity name or value. Aborted");
         return;
     }
     if (properties == null || properties.Count == 0)
     {
         Debug.LogError("AttachEntityAttributes has empty properties dictionary. Aborted");
         return;
     }
     AppmetrPlatformPlugin.AttachEntityAttributes(entityName, entityValue, properties);
 }
Beispiel #5
0
 /// <summary>
 /// Sets mandatory plugin parameters
 /// </summary>
 /// <param name="token">Deploy token as assigned on backend</param>
 /// <param name="platform">Platform or store name. Changes behaviour of
 /// certain events, especially payment tracking. Optional</param>
 public static void Setup(string token, string platform = null)
 {
     AppmetrPlatformPlugin.SetupWithToken(token, platform);
     AppmetrPlatformPlugin.AttachProperties(new Dictionary <string, object>
     {
         { "cpu", SystemInfo.processorType },
         { "cpu_cores", SystemInfo.processorCount },
         { "cpu_frequency", SystemInfo.processorFrequency },
         { "gpu", SystemInfo.graphicsDeviceName },
         { "ram", SystemInfo.systemMemorySize },
         { "screen_size", GetScreenDiagonal() },
         { "screen_resolution", $"{Screen.currentResolution.width}x{Screen.currentResolution.height}" },
         { "device_model", SystemInfo.deviceModel }
     });
 }
Beispiel #6
0
 /// <summary>
 /// Method for tracking game event as "track session" with parameters.
 /// </summary>
 /// <param name="properties">
 /// Properties for event.
 /// </param>
 public static void TrackSession(IDictionary <string, object> properties)
 {
     AppmetrPlatformPlugin.TrackSession(properties);
 }
Beispiel #7
0
 /// <summary>
 /// Method for tracking game event as "track session" without parameters.
 /// </summary>
 public static void TrackSession()
 {
     AppmetrPlatformPlugin.TrackSession();
 }
Beispiel #8
0
 /// <summary>
 /// Return a set of device ids, encoded in a query string
 /// </summary>
 public static string GetDeviceKey()
 {
     return(AppmetrPlatformPlugin.GetDeviceKey());
 }
Beispiel #9
0
 /// <summary>
 /// Force flush events to disk. Flushing execute in new thread.
 /// </summary>
 public static void FlushLocal()
 {
     AppmetrPlatformPlugin.FlushLocal();
 }
Beispiel #10
0
 /// <summary>
 /// Return full instance identifier.
 /// </summary>
 public static string GetInstanceIdentifier()
 {
     return(AppmetrPlatformPlugin.GetInstanceIdentifier());
 }
Beispiel #11
0
 /// <summary>
 /// Identify user.
 /// </summary>
 /// <param name='userId'>
 /// User identifier.
 /// </param>
 public static void Identify(string userId)
 {
     AppmetrPlatformPlugin.Identify(userId);
 }
Beispiel #12
0
 /// <summary>
 /// Method for tracking game event as "track event" with parameter "event".
 /// </summary>
 /// <param name="eventName">
 /// Required field. Displays event's named.
 /// </param>
 public static void TrackEvent(string eventName)
 {
     AppmetrPlatformPlugin.TrackEvent(eventName);
 }
Beispiel #13
0
 /// <summary>
 /// Method for tracking user state.
 /// </summary>
 /// <param name='state'>
 /// state.
 /// </param>
 public static void TrackState(IDictionary <string, object> state)
 {
     AppmetrPlatformPlugin.TrackState(state);
 }
Beispiel #14
0
 /// <summary>
 /// Method for attaching user properties.
 /// </summary>
 /// <param name='properties'>
 /// Properties.
 /// </param>
 public static void AttachProperties(IDictionary <string, object> properties)
 {
     AppmetrPlatformPlugin.AttachProperties(properties);
 }
Beispiel #15
0
 /// <summary>
 /// Method for attaching only built-in user properties.
 /// </summary>
 public static void AttachProperties()
 {
     AppmetrPlatformPlugin.AttachProperties();
 }
Beispiel #16
0
 /// <summary>
 /// Method must be called when player does any payment.
 /// </summary>
 /// <param name="payment">
 /// Required fields "psUserSpentCurrencyCode", "psUserSpentCurrencyAmount", "psReceivedCurrencyCode" and "psReceivedCurrencyAmount".
 ///	If these fields are not found library throws an exception.
 /// </param>
 /// <param name="properties">
 /// Additional information for event.
 /// </param>
 public static void TrackPayment(IDictionary <string, object> payment, IDictionary <string, object> properties)
 {
     AppmetrPlatformPlugin.TrackPayment(payment, properties);
 }
Beispiel #17
0
 /// <summary>
 /// Method for tracking game event as "track event" with parameters "event","value" and "properties".
 /// </summary>
 /// <param name="eventName">
 /// Required field. Displays event's named.
 /// </param>
 /// <param name="properties">
 /// Additional parameters for event.
 /// </param>
 public static void TrackEvent(string eventName, IDictionary <string, object> properties)
 {
     AppmetrPlatformPlugin.TrackEvent(eventName, properties);
 }