Created
July 9, 2020 00:33
-
-
Save daoshengmu/3f421250db3c41502dab31cd366438a8 to your computer and use it in GitHub Desktop.
Glean initialize before setuploadenabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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