Class UserReportingClient
Represents a user reporting client.
Inheritance
Inherited Members
Namespace: Unity.Cloud.UserReporting.Client
Assembly: Unity.Cloud.UserReporting.Client.dll
Syntax
public class UserReportingClient
Constructors
UserReportingClient(String, String, IUserReportingPlatform, UserReportingClientConfiguration)
Creates a new instance of the UserReportingClient class.
Declaration
public UserReportingClient(string endpoint, string projectIdentifier, IUserReportingPlatform platform, UserReportingClientConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
System.String | endpoint | The endpoint. |
System.String | projectIdentifier | The project identifier. |
IUserReportingPlatform | platform | The platform. |
UserReportingClientConfiguration | configuration | The configuration. |
Properties
Configuration
Gets the configuration.
Declaration
public UserReportingClientConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
UserReportingClientConfiguration |
Endpoint
Gets the endpoint.
Declaration
public string Endpoint { get; }
Property Value
Type | Description |
---|---|
System.String |
IsConnectedToLogger
Gets or sets a value indicating whether the client is connected to the logger. If true, log messages will be included in user reports.
Declaration
public bool IsConnectedToLogger { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSelfReporting
Gets or sets a value indicating whether the client is self reporting. If true, event and metrics about the client will be included in user reports.
Declaration
public bool IsSelfReporting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Platform
Gets the platform.
Declaration
public IUserReportingPlatform Platform { get; }
Property Value
Type | Description |
---|---|
IUserReportingPlatform |
ProjectIdentifier
Gets the project identifier.
Declaration
public string ProjectIdentifier { get; }
Property Value
Type | Description |
---|---|
System.String |
SendEventsToAnalytics
Gets or sets a value indicating whether user reporting events should be sent to analytics.
Declaration
public bool SendEventsToAnalytics { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddDeviceMetadata(String, String)
Adds device metadata.
Declaration
public void AddDeviceMetadata(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.String | value | The value. |
AddMeasureMetadata(String, String)
Adds measure metadata. Measure metadata is associated with a period of time.
Declaration
public void AddMeasureMetadata(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.String | value | The value. |
ClearScreenshots()
Clears the screenshots.
Declaration
public void ClearScreenshots()
CreateUserReport(Action<UserReport>)
Creates a user report.
Declaration
public void CreateUserReport(Action<UserReport> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action<UserReport> | callback | The callback. Provides the user report that was created. |
GetEndpoint()
Gets the endpoint.
Declaration
public string GetEndpoint()
Returns
Type | Description |
---|---|
System.String | The endpoint. |
LogEvent(UserReportEventLevel, String)
Logs an event.
Declaration
public void LogEvent(UserReportEventLevel level, string message)
Parameters
Type | Name | Description |
---|---|---|
UserReportEventLevel | level | The level. |
System.String | message | The message. |
LogException(Exception)
Logs an exception.
Declaration
public void LogException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | exception | The exception. |
SampleClientMetric(String, Double)
Samples a client metric. These metrics are only sample when self reporting is enabled.
Declaration
public void SampleClientMetric(string name, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.Double | value | The value. |
SampleMetric(String, Double)
Samples a metric. Metrics can be sampled frequently and have low overhead.
Declaration
public void SampleMetric(string name, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.Double | value | The value. |
SaveUserReportToDisk(UserReport)
Saves a user report to disk.
Declaration
public void SaveUserReportToDisk(UserReport userReport)
Parameters
Type | Name | Description |
---|---|---|
UserReport | userReport | The user report. |
SendUserReport(UserReport, Action<Boolean, UserReport>)
Sends a user report to the server.
Declaration
public void SendUserReport(UserReport userReport, Action<bool, UserReport> callback)
Parameters
Type | Name | Description |
---|---|---|
UserReport | userReport | The user report. |
System.Action<System.Boolean, UserReport> | callback | The callback. Provides a value indicating whether sending the user report was successful and provides the user report after it is modified by the server. |
SendUserReport(UserReport, Action<Single, Single>, Action<Boolean, UserReport>)
Sends a user report to the server.
Declaration
public void SendUserReport(UserReport userReport, Action<float, float> progressCallback, Action<bool, UserReport> callback)
Parameters
Type | Name | Description |
---|---|---|
UserReport | userReport | The user report. |
System.Action<System.Single, System.Single> | progressCallback | The progress callback. Provides the upload and download progress. |
System.Action<System.Boolean, UserReport> | callback | The callback. Provides a value indicating whether sending the user report was successful and provides the user report after it is modified by the server. |
TakeScreenshot(Int32, Int32, Action<UserReportScreenshot>)
Takes a screenshot.
Declaration
public void TakeScreenshot(int maximumWidth, int maximumHeight, Action<UserReportScreenshot> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maximumWidth | The maximum width. |
System.Int32 | maximumHeight | The maximum height. |
System.Action<UserReportScreenshot> | callback | The callback. Provides the screenshot. |
TakeScreenshotFromSource(Int32, Int32, Object, Action<UserReportScreenshot>)
Takes a screenshot.
Declaration
public void TakeScreenshotFromSource(int maximumWidth, int maximumHeight, object source, Action<UserReportScreenshot> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maximumWidth | The maximum width. |
System.Int32 | maximumHeight | The maximum height. |
System.Object | source | The source. Passing null will capture the screen. Passing a camera will capture the camera's view. Passing a render texture will capture the render texture. |
System.Action<UserReportScreenshot> | callback | The callback. Provides the screenshot. |
Update()
Updates the user reporting client, which updates networking communication, screenshotting, and metrics gathering.
Declaration
public void Update()
UpdateOnEndOfFrame()
Updates the user reporting client at the end of the frame, which updates networking communication, screenshotting, and metrics gathering.
Declaration
public void UpdateOnEndOfFrame()