Exemplo n.º 1
0
    /// <summary>
    /// Sets the property for this user which is logged along with the events of this user.
    /// Warning: It is against the rules to log personal information even if it's hashed such as email or names!
    /// </summary>
    /// <param name="propertyName">Property name.</param>
    /// <param name="propertyValue">Property value.</param>
    public static void SetUserProperty(string propertyName, string propertyValue)
    {
                #if analytics
        if (!IsReserved(propertyName))
        {
            bool doesPropertyValueNeedLimiting = propertyValue.Length > 36;

            if (doesPropertyValueNeedLimiting)
            {
                propertyValue = propertyValue.Substring(0, 36);
            }

            FirebaseAnalytics.SetUserProperty(propertyName, propertyValue);
            Crashlytics.SetKeyValue(propertyName, propertyValue);

            ProjectManager.Log("[Analytics User Property] " + propertyName + " = " + propertyValue);
        }
                #endif
    }