curved-fountain-55190
02/15/2023, 9:13 PMRudderClient.SerializeSqlite();
RudderConfig config = new RudderConfigBuilder()
.WithDataPlaneUrl("https://***.dataplane.rudderstack.com")
.Build();
RudderClient rudderClient = RudderClient.GetInstance("********Dc6wXH5V1VZ4MTAUQ4", config);
Debug.Log(rudderClient);
but rudderClient object still has the value null.. is that normal? if not what's went wrong?curved-fountain-55190
02/15/2023, 9:18 PM.WithLogLevel(RudderLogLevel.VERBOSE) and this is the logs:calm-yak-10773
02/16/2023, 6:33 AMcurved-fountain-55190
02/16/2023, 10:57 AMcalm-yak-10773
02/16/2023, 11:02 AMcurved-fountain-55190
02/16/2023, 11:44 AMObject reference not set to an instance of an object on the track line.
I think it's because of the null object of RudderClient, is that can help with anything?curved-fountain-55190
02/16/2023, 11:46 AMprivate void UserVisit()
{
string userName = PlayerPrefs.GetString("Username");
string userEmail = PlayerPrefs.GetString("email");
string colorPicked = PlayerPrefs.GetString("Color"); ;
string clientVersion = Application.version.ToString();
string platform = Application.platform.ToString();
DateTime visitTime = DateTime.Now;
// create event properties
Dictionary<string, object> eventProperties = new Dictionary<string, object>
{
{ "color_picked", colorPicked },
{ "ip_address", ipAddress },
{ "country", userCountry },
{ "platform", platform },
{ "client-version", clientVersion },
{ "visit_time", visitTime.ToString() }
};
// create user properties
Dictionary<string, object> userProperties = new Dictionary<string, object>
{
{ "user_name", userName },
{ "user_email", userEmail }
};
// create message to track
RudderMessageBuilder builder = new RudderMessageBuilder();
builder.WithEventName("Player-Visit-WEB");
builder.WithEventProperties(eventProperties);
builder.WithUserProperties(userProperties);
Debug.Log("Sending tracking event...");
try
{
rudderClient.Track(builder.Build());
Debug.Log("Tracking event sent successfully");
Destroy(this);
}
catch (Exception ex)
{
Debug.LogError("Failed to send tracking event: " + ex.Message);
}
}curved-fountain-55190
02/16/2023, 11:47 AMcalm-yak-10773
02/16/2023, 11:49 AMcurved-fountain-55190
02/16/2023, 11:52 AMcalm-yak-10773
02/16/2023, 11:55 AM