Example #1
0
        public static string ApplyMD5(string str)
        {
            byte[]        array         = SwrveHelper.MD5(str);
            StringBuilder stringBuilder = new StringBuilder();

            for (int i = 0; i < array.Length; i++)
            {
                stringBuilder.Append(array[i].ToString("x2"));
            }
            return(stringBuilder.ToString());
        }
Example #2
0
        private static string CreateSessionToken(string apiKey, int appId, string userId, long time)
        {
            string text = SwrveHelper.ApplyMD5(string.Format("{0}{1}{2}", userId, time, apiKey));

            return(string.Format("{0}={1}={2}={3}", new object[]
            {
                appId,
                userId,
                time,
                text
            }));
        }
        protected static string CreateSessionToken(string apiKey, int appId, string userId, long time)
        {
            var md5Hash = SwrveHelper.ApplyMD5(String.Format("{0}{1}{2}", userId, time, apiKey));

            return(String.Format("{0}={1}={2}={3}", appId, userId, time, md5Hash));
        }
Example #4
0
 public static bool IsOnDevice()
 {
     return(SwrveHelper.IsAvailableOn(RuntimePlatform.Android));
 }
Example #5
0
 public static bool IsNotOnDevice()
 {
     return(!SwrveHelper.IsOnDevice());
 }
Example #6
0
        private static string CreateSessionToken(string apiKey, int appId, string userId, long time)
        {
            string text = SwrveHelper.ApplyMD5($"{userId}{time}{apiKey}");

            return($"{appId}={userId}={time}={text}");
        }