Skip to content

Instantly share code, notes, and snippets.

@daoshengmu
Created July 9, 2020 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daoshengmu/3f421250db3c41502dab31cd366438a8 to your computer and use it in GitHub Desktop.
Save daoshengmu/3f421250db3c41502dab31cd366438a8 to your computer and use it in GitHub Desktop.
Glean initialize before setuploadenabled
GleanInstance.Initialize(
applicationId: "org.mycompany.glean.tests",
applicationVersion: "0.1",
uploadEnabled: true,
configuration: new Configuration(channel: "debug", maxEvents: 500, pingTag: "unity_glean"),
dataDir: "data"
);
GleanInstance.SetUploadEnabled(false);
// Create a custom ping.
var ping = new PingType<NoReasonCodes>(
name: "custom",
includeClientId: true,
sendIfEmpty: false,
reasonCodes: null
);
// Init launch ping.
var metric = new StringMetricType(
category: "hello_world",
disabled: false,
lifetime: Lifetime.Application,
name: "test",
sendInPings: new string[] { "custom" }
);
metric.Set("my_data");
ping.Submit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment