public void TestValidateUserId() { Assert.True(GAValidator.ValidateUserId("fhjkdfghdfjkgh")); Assert.False(GAValidator.ValidateUserId(null)); Assert.False(GAValidator.ValidateUserId("")); }
public static void SetCustomUserId(string userId) { #if UNITY_EDITOR if (GAValidator.ValidateUserId(userId)) { configureUserId(userId); } #else configureUserId(userId); #endif }
public static void ConfigureUserId(string uId) { GAThreading.PerformTaskOnGAThread("configureUserId", () => { if (IsSdkReady(true, false)) { GALogger.W("A custom user id must be set before SDK is initialized."); return; } if (!GAValidator.ValidateUserId(uId)) { GALogger.I("Validation fail - configure user_id: Cannot be null, empty or above 64 length. Will use default user_id method. Used string: " + uId); return; } GAState.UserId = uId; }); }