Interface IUserReporting
Provides the access point for User Reporting functionality.
Namespace: Unity.Services.UserReporting
Assembly: Unity.Services.UserReporting.dll
Syntax
public interface IUserReporting
Properties
HasOngoingReport
Checks whether or not User Reporting possesses a current User Report that has not been submitted.
Declaration
bool HasOngoingReport { get; }
Property Value
Type | Description |
---|---|
bool |
SendEventsToAnalytics
Whether or not User Reporting should produce an event in Unity Analytics when new reports are submitted.
Declaration
[Obsolete("SendEventsToAnalytics is deprecated, please use the UGS Analytics SDK for your needs.")]
bool SendEventsToAnalytics { get; set; }
Property Value
Type | Description |
---|---|
bool |
SendInternalMetrics
Whether or not User Reporting should track metrics about itself and include them in reports.
Declaration
bool SendInternalMetrics { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddAttachmentToReport(string, string, byte[], string)
Adds an attachment to User Reporting. For the attachment to work correctly when accessing them in reports on the dashboard, please ensure you provide the correct IANA media type for your file.
Declaration
void AddAttachmentToReport(string title, string filename, byte[] data, string mediaType = "")
Parameters
Type | Name | Description |
---|---|---|
string | title | The title of the attachment. |
string | filename | The filename of the attachment, which appears when inspecting User Report attachments within the dashboard. |
byte[] | data | The data of the attachment as a byte array. |
string | mediaType | The IANA media type of the attachment. For example: "attachment/json" |
AddDimensionValue(string, string)
Adds a Dimension Value to the current User Report, and creates a new Dimension for the report if it doesn't already exist.
Declaration
void AddDimensionValue(string dimension, string value)
Parameters
Type | Name | Description |
---|---|---|
string | dimension | The Dimension the value will be added to. |
string | value | The value that will be added to the dimension. |
AddMetadata(string, string)
Adds a piece of metadata to the current User Report, which will appear in reports alongsde the device metadata included in reports by default.
Declaration
void AddMetadata(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name the value will be titled with in the report. |
string | value | The value that will appear under the given name in the report. |
ClearOngoingReport()
Discards the current User Report.
Declaration
void ClearOngoingReport()
Configure(UserReportingClientConfiguration, string)
Configures User Reporting to default values, or using optional parameters. Any unsent User Reporting data will be lost when reconfiguring.
Declaration
void Configure(UserReportingClientConfiguration configuration = null, string projectIdentifier = null)
Parameters
Type | Name | Description |
---|---|---|
User |
configuration | Option to use a given UserReportingClientConfiguration |
string | projectIdentifier | Option to send reports to the given Unity Project ID dashboard |
CreateNewUserReport(Action)
Creates a new User Report, which will clear the previous current User Report if one exists, and populates it with the latest screenshots, attachments, and metrics collected by User Reporting.
Declaration
void CreateNewUserReport(Action callback = null)
Parameters
Type | Name | Description |
---|---|---|
Action | callback | Optional Action which is invoked after the report is created. |
GetLatestScreenshot()
The latest screenshot taken by User Reporting.
Declaration
Texture2D GetLatestScreenshot()
Returns
Type | Description |
---|---|
Texture2D | Returns the latest screenshot taken by User Reporting if one exists, otherwise null. |
LogEvent(UserReportEventLevel, string)
Logs an event.
Declaration
void LogEvent(UserReportEventLevel level, string message)
Parameters
Type | Name | Description |
---|---|---|
User |
level | The level to categorize this event in. |
string | message | The message to accompany the event. |
SampleMetric(string, double)
Creates a sample a metric with the given value, creating a new metric if it doesn't already exist.
Declaration
void SampleMetric(string name, double value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the metric. |
double | value | The value of the metric used in this sample. |
SendUserReport(Action<float>, Action<bool>)
Sends the current User Report, and provides two optional Actions to track the progress of the report submission and handle the completion of the submission respectively.
Declaration
void SendUserReport(Action<float> progressUpdate, Action<bool> result)
Parameters
Type | Name | Description |
---|---|---|
Action<float> | progressUpdate | Action to track the submission progress via float values 0.0 to 1.0. |
Action<bool> | result | Action called when the submission attempt is done, with a bool indicating whether it was successful or not. |
SetEndpoint(string)
Sets User Reporting to submit User Reports to a custom endpoint.
Declaration
void SetEndpoint(string endpoint)
Parameters
Type | Name | Description |
---|---|---|
string | endpoint | The endpoint to be used. |
SetProjectIdentifier(string)
Selects to send reports to the current project's Unity Project ID dashboard, or to the optional Unity Project ID parameter.
Declaration
void SetProjectIdentifier(string projectIdentifier = null)
Parameters
Type | Name | Description |
---|---|---|
string | projectIdentifier | Option to send reports to given Unity Project ID dashboard |
SetReportDescription(string)
Sets the description of the current User Report.
Declaration
void SetReportDescription(string description)
Parameters
Type | Name | Description |
---|---|---|
string | description | The text that will be used as the description. |
SetReportSummary(string)
Sets the summary of the current User Report.
Declaration
void SetReportSummary(string summaryInputText)
Parameters
Type | Name | Description |
---|---|---|
string | summaryInputText | The text used as the summary. |
TakeScreenshot(int, int, object)
Takes a screenshot of the given maximum dimensions from the screen view by default, or optionally from a given source object such as a Camera, for use in User Reports.
Declaration
void TakeScreenshot(int maximumWidth, int maximumHeight, object source = null)