Class Embrace
Inheritance
Namespace: EmbraceSDK
Assembly: cs.temp.dll.dll
Syntax
public class Embrace : MonoBehaviour
Properties
Instance
Declaration
public static Embrace Instance { get; }
Property Value
Type | Description |
---|---|
Embrace |
Methods
__BridgedHTTPMethod(HTTPMethod)
Declaration
public static int __BridgedHTTPMethod(HTTPMethod method)
Parameters
Type | Name | Description |
---|---|---|
HTTPMethod | method |
Returns
Type | Description |
---|---|
System.Int32 |
AddSessionProperty(String, String, Boolean)
Annotates the session with a new property. Use this to track permanent and ephemeral features of the session. A permanent property is added to all sessions submitted from this device, use this for properties such as work site, building, owner. A non-permanent property is added to only the currently active session. There is a maximum of 10 total properties in a session.
Declaration
public void AddSessionProperty(string key, string value, bool permanent)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the key for this property, must be unique within session properties |
System.String | value | the value to store for this property |
System.Boolean | permanent | if true the property is applied to all sessions going forward, persist through app launches. |
ClearAllUserPersonas()
Clears all custom user personas from the user.
Declaration
public void ClearAllUserPersonas()
ClearUserAsPayer()
Clears this user as a paying user. This would typically be called if a user is no longer paying for the service and has reverted back to a basic user.
Declaration
public void ClearUserAsPayer()
ClearUserEmail()
Clears the currently set user's email address.
Declaration
public void ClearUserEmail()
ClearUserIdentifier()
Declaration
public void ClearUserIdentifier()
ClearUsername()
Clears the username of the currently logged in user, for example if the user has logged out.
Declaration
public void ClearUsername()
ClearUserPersona(String)
Clears the custom user persona, if it is set.
Declaration
public void ClearUserPersona(string persona)
Parameters
Type | Name | Description |
---|---|---|
System.String | persona | the persona to clear |
Crash()
Causes a crash. Use this for test purposes only.
Declaration
public void Crash()
Embrace_Log_Handler(String, String, LogType)
Declaration
public void Embrace_Log_Handler(string message, string stack, LogType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | |
System.String | stack | |
LogType | type |
EnableDebugLogging()
Enables debug logging.
Declaration
public void EnableDebugLogging()
EndAppStartup(Dictionary<String, String>)
Signals that the app has completed startup.
Declaration
public void EndAppStartup(Dictionary<string, string> properties = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | properties | Properties to include as part of the startup moment |
EndMoment(String, String, Dictionary<String, String>)
Stops recording data for an app moment with the provided name (and identifier), and adds properties to the moment. This marks the moment as “completed.” If no moment is found with the provided name (and an empty identifier), this call will be ignored. Additionally, if an app moment was started with a name and identifier, the same identifier must be used to end it.
Declaration
public void EndMoment(string name, string identifier = null, Dictionary<string, string> properties = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the name used to identify the moment |
System.String | identifier | an identifier that is combined with the name to create a unique key for the moment (can be null) |
System.Collections.Generic.Dictionary<System.String, System.String> | properties | an optional dictionary containing metadata about the moment to be recorded (limited to 10 keys) |
EndSession(Boolean)
Ends the current session and starts a new one.
Declaration
public void EndSession(bool clearUserInfo = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | clearUserInfo | if true, clears all the user info on the device |
EndView(String)
Closes the view state for the specified view or logs a warning if the view is not found.
Declaration
public bool EndView(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | name of the view state |
Returns
Type | Description |
---|---|
System.Boolean | a boolean indicating whether the operation was successful or not |
GetDeviceId()
Get the user identifier assigned to the device by Embrace.
Declaration
public string GetDeviceId()
Returns
Type | Description |
---|---|
System.String | the device identifier created by Embrace |
GetSessionProperties()
Get a read-only representation of the currently set session properties.
Declaration
public Dictionary<string, string> GetSessionProperties()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | the properties as key-value pairs of strings |
LogBreadcrumb(String)
Logs a breadcrumb. Breadcrumbs track a user's journey through the application and will be shown on the timeline.
Declaration
public void LogBreadcrumb(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | the name of the breadcrumb to log |
LogMessage(String, EMBSeverity, Dictionary<String, String>, Boolean)
Logs an event in your application for aggregation and debugging on the Embrace.io dashboard with an optional dictionary of up to 10 properties and the ability to enable or disable a screenshot.
Declaration
public void LogMessage(string message, EMBSeverity severity, Dictionary<string, string> properties = null, bool allowScreenshot = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | the name of the message, which is how it will show up on the dashboard |
EMBSeverity | severity | will flag the message as one of info, warning, or error for filtering on the dashboard |
System.Collections.Generic.Dictionary<System.String, System.String> | properties | an optional dictionary of up to 10 key/value pairs |
System.Boolean | allowScreenshot | a flag for whether the SDK should take a screenshot of the application window to display on the dashboard (defaults to false) |
LogNetworkRequest(String, HTTPMethod, Int64, Int64, Int32, Int32, Int32, String)
Declaration
public void LogNetworkRequest(string url, HTTPMethod method, long startms, long endms, int bytesin, int bytesout, int code, string error)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | |
HTTPMethod | method | |
System.Int64 | startms | |
System.Int64 | endms | |
System.Int32 | bytesin | |
System.Int32 | bytesout | |
System.Int32 | code | |
System.String | error |
logUnhandledUnityException(String, String)
Declaration
public void logUnhandledUnityException(string exceptionMessage, string stack)
Parameters
Type | Name | Description |
---|---|---|
System.String | exceptionMessage | |
System.String | stack |
RemoveSessionProperty(String)
Removes a property from the session. If that property was permanent then it is removed from all future sessions as well.
Declaration
public void RemoveSessionProperty(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the key for the property you wish to remove |
SetUserAsPayer()
Sets this user as a paying user. This adds a persona to the user's identity.
Declaration
public void SetUserAsPayer()
SetUserEmail(String)
Sets the current user's email address.
Declaration
public void SetUserEmail(string email)
Parameters
Type | Name | Description |
---|---|---|
System.String | the email address of the current user |
SetUserIdentifier(String)
Sets the user ID. This would typically be some form of unique identifier such as a UUID or database key for the user.
Declaration
public void SetUserIdentifier(string identifier)
Parameters
Type | Name | Description |
---|---|---|
System.String | identifier | the unique identifier for the user |
SetUsername(String)
Sets the username of the currently logged in user.
Declaration
public void SetUsername(string username)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | the username to set |
SetUserPersona(String)
Sets a custom user persona. A persona is a trait associated with a given user.
Declaration
public void SetUserPersona(string persona)
Parameters
Type | Name | Description |
---|---|---|
System.String | persona | the persona to set |
StartMoment(String, String, Boolean, Dictionary<String, String>)
Starts recording data for an app moment with the provided name, optional identifier, screenshot flag, and optional key/value metadata
Declaration
public void StartMoment(string name, string identifier = null, bool allowScreenshot = true, Dictionary<string, string> properties = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the name used to identify the moment |
System.String | identifier | an identifier that is combined with the name to create a unique key for the moment (can be null) |
System.Boolean | allowScreenshot | a flag for whether to take a screenshot if the moment is late (defaults to true) |
System.Collections.Generic.Dictionary<System.String, System.String> | properties | an optional dictionary containing metadata about the moment to be recorded (limited to 10 keys) |
StartSDK(Boolean)
Starts instrumentation of the application using the Embrace SDK. This should be called during creation of the application, as early as possible. See Embrace Docs for integration instructions. For compatibility with other SDKs, the Embrace SDK must be initialized after any other SDK.
Declaration
public void StartSDK(bool enableIntegrationTesting = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enableIntegrationTesting | If true, debug sessions (those which are not part of a release APK) will go to the live integration testing tab of the dashboard. If false, they will appear in 'recent sessions'. |
StartView(String)
Opens a view. There is a limit to 10 "started" views.
Declaration
public bool StartView(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | name of the view state as it will show up on our dashboard |
Returns
Type | Description |
---|---|
System.Boolean | a boolean indicating whether the operation was successful or not |