Embrace

Objective-C

@interface Embrace : NSObject

Swift

class Embrace : NSObject

Entry point for Embrace SDK.

  • Optional delegate property that can be set to receive callbacks about the Embrace.io SDK’s operations

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<EmbraceDelegate> delegate;

    Swift

    weak var delegate: EmbraceDelegate? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) BOOL isStarted

    Swift

    var isStarted: Bool { get set }
  • Returns the shared Embrace singleton object.

    Declaration

    Objective-C

    + (nonnull instancetype)sharedInstance;

    Swift

    class func sharedInstance() -> Self
  • Performs the initial setup of the Embrace SDK with the default config file if present

    Declaration

    Objective-C

    - (void)start;

    Swift

    func start()
  • Performs the initial setup of the Embrace SDK with the default config file if present

    Declaration

    Objective-C

    - (void)startWithLaunchOptions:(nullable NSDictionary *)launchOptions;

    Swift

    func start(launchOptions: [AnyHashable : Any]? = nil)

    Parameters

    launchOptions

    The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].

  • Performs the initial setup of the Embrace SDK with the default config file if present

    Declaration

    Objective-C

    - (void)startWithLaunchOptions:(nullable NSDictionary *)launchOptions
                         framework:(id)framework;

    Swift

    func start(launchOptions: [AnyHashable : Any]? = nil, framework: Any!)

    Parameters

    launchOptions

    The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].

    framework

    The framework used by the app, e.g. EMBAppFrameworkReactNative.

  • Performs the initial setup of the Embrace SDK with a custom EmbraceConfig.

    Declaration

    Objective-C

    - (void)startWithConfig:(id)config;

    Swift

    func start(withConfig config: Any!)

    Parameters

    config

    The Embrace application object used to configure the service.

  • Performs the initial setup of the Embrace SDK with a custom EmbraceConfig.

    Declaration

    Objective-C

    - (void)startWithConfig:(id)config
              launchOptions:
                  (nullable NSDictionary<UIApplicationLaunchOptionsKey, id> *)
                      launchOptions;

    Swift

    func start(withConfig config: Any!, launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil)

    Parameters

    config

    The Embrace application object used to configure the service.

    launchOptions

    The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].

  • Performs the initial setup of the Embrace SDK with the provided API key.

    This puts in place device and network monitoring, kicks off reporting, and marks the beginning of the “App Startup” event.

    Declaration

    Objective-C

    - (void)startWithKey:(nonnull NSString *)apiKey;

    Swift

    func start(withKey apiKey: String)

    Parameters

    apiKey

    The unique Embrace API key that identifies your application.

  • Performs the initial setup of the Embrace SDK with the provided API key.

    This puts in place device and network monitoring, kicks off reporting, and marks the beginning of the “App Startup” event.

    Declaration

    Objective-C

    - (void)startWithKey:(nonnull NSString *)apiKey
           launchOptions:
               (nullable NSDictionary<UIApplicationLaunchOptionsKey, id> *)
                   launchOptions;

    Swift

    func start(withKey apiKey: String, launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil)

    Parameters

    apiKey

    The unique Embrace API key that identifies your application.

    launchOptions

    The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].

  • Performs the initial setup of the Embrace SDK with the provided API key.

    This puts in place device and network monitoring, kicks off reporting, and marks the beginning of the “App Startup” event.

    Declaration

    Objective-C

    - (void)startWithKey:(nonnull NSString *)apiKey
           launchOptions:
               (nullable NSDictionary<UIApplicationLaunchOptionsKey, id> *)
                   launchOptions
               framework:(id)framework;

    Swift

    func start(withKey apiKey: String, launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil, framework: Any!)

    Parameters

    apiKey

    The unique Embrace API key that identifies your application.

    launchOptions

    The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].

    framework

    The framework used by the app, e.g. EMBAppFrameworkReactNative.

  • Manually forces the end of the current session and starts a new session.

    Only call this method if you have an application that will stay in the foreground for an extended time, such as a point-of-sale app.

    Declaration

    Objective-C

    - (void)endSession;

    Swift

    func endSession()
  • Manually forces the end of the current session and starts a new session.

    Only call this method if you have an application that will stay in the foreground for an extended time, such as a point-of-sale app.

    Declaration

    Objective-C

    - (void)endSession:(BOOL)clearUserInfo;

    Swift

    func endSession(_ clearUserInfo: Bool)

    Parameters

    clearUserInfo

    Clear any username, user ID, and email values set when ending the session.

  • Marks the end of the “App Startup” event.

    Declaration

    Objective-C

    - (void)endAppStartup;

    Swift

    func endAppStartup()
  • Marks the end of the “App Startup” event with optional properties added

    Declaration

    Objective-C

    - (void)endAppStartupWithProperties:(id)properties;

    Swift

    func endAppStartup(withProperties properties: Any!)

    Parameters

    properties

    An optional dictionary containing metadata about the moment to be recorded (limited to 10 keys).

  • Deprecated

    Please replace calls to start app moments with methods of the form startMomentWithName:

    Starts recording data for an app moment with the provided name.

    If another app moment with the provided name is in progress, it will be overwritten.

    Declaration

    Objective-C

    - (void)beginEventWithName:(nonnull NSString *)name;

    Swift

    func beginEvent(withName name: String)

    Parameters

    name

    The name used to identify the app moment

  • Starts recording data for an app moment with the provided name.

    If another app moment with the provided name is in progress, it will be overwritten.

    Declaration

    Objective-C

    - (void)startMomentWithName:(nonnull NSString *)name;

    Swift

    func startMoment(withName name: String)

    Parameters

    name

    The name used to identify the app moment

  • Deprecated

    Please replace calls to start app moments with methods of the form startMomentWithName:identifier:

    Starts recording data for an app moment with the provided name and identifier.

    Identifiers can be used to separately log data for different instances of a given moment, e.g. an image download. All moments will be aggregated by name—the identifier is purely for avoiding naming collisions. A start event with a given name, identifier pair will overwrite any existing app moments with the same name and identifier.

    Declaration

    Objective-C

    - (void)beginEventWithName:(nonnull NSString *)name
                    identifier:(nullable NSString *)identifier;

    Swift

    func beginEvent(withName name: String, identifier: String?)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to create a unique key for the moment.

  • Starts recording data for an app moment with the provided name and identifier.

    Identifiers can be used to separately log data for different instances of a given moment, e.g. an image download. All moments will be aggregated by name—the identifier is purely for avoiding naming collisions. A start event with a given name, identifier pair will overwrite any existing app moments with the same name and identifier.

    Declaration

    Objective-C

    - (void)startMomentWithName:(nonnull NSString *)name
                     identifier:(nullable NSString *)identifier;

    Swift

    func startMoment(withName name: String, identifier: String?)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to create a unique key for the moment.

  • Deprecated

    Please replace calls to start app moments with methods of the form startMomentWithName:identifier:allowScreenshot:

    Starts recording data for an app moment with the provided name, optional identifier, and option to take a screenshot. Screenshots will be taken if the SDK detects that the moment is late (taking longer than it should). Note: screenshots will be rate-limited, so if two moments trigger screenshots within 1 second of each other, only one screenshot will be taken.

    Declaration

    Objective-C

    - (void)beginEventWithName:(nonnull NSString *)name
                    identifier:(nullable NSString *)identifier
               allowScreenshot:(BOOL)allowScreenshot;

    Swift

    func beginEvent(withName name: String, identifier: String?, allowScreenshot: Bool)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to create a unique key for the moment (can be nil).

    allowScreenshot

    A flag for whether to enable screenshot functionality if the moment is late (defaults to YES).

  • Starts recording data for an app moment with the provided name, optional identifier, and option to take a screenshot. Screenshots will be taken if the SDK detects that the moment is late (taking longer than it should). Note: screenshots will be rate-limited, so if two moments trigger screenshots within 1 second of each other, only one screenshot will be taken.

    Declaration

    Objective-C

    - (void)startMomentWithName:(nonnull NSString *)name
                     identifier:(nullable NSString *)identifier
                allowScreenshot:(BOOL)allowScreenshot;

    Swift

    func startMoment(withName name: String, identifier: String?, allowScreenshot: Bool)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to create a unique key for the moment (can be nil).

    allowScreenshot

    A flag for whether to enable screenshot functionality if the moment is late (defaults to YES).

  • Starts recording data for an app moment with the provided name, optional identifier, and optional key/value metadata

    Declaration

    Objective-C

    - (void)startMomentWithName:(nonnull NSString *)name
                     identifier:(nullable NSString *)identifier
                     properties:(id)properties;

    Swift

    func startMoment(withName name: String, identifier: String?, properties: Any!)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to create a unique key for the moment (can be nil).

    properties

    An optional dictionary containing metadata about the moment to be recorded (limited to 10 keys).

  • Deprecated

    Please replace calls to start app moments with methods of the form startMomentWithName:identifier:allowScreenshot:properties:

    Starts recording data for an app moment with the provided name, optional identifier, screenshot flag, and optional key/value metadata

    Declaration

    Objective-C

    - (void)beginEventWithName:(nonnull NSString *)name
                    identifier:(nullable NSString *)identifier
               allowScreenshot:(BOOL)allowScreenshot
                    properties:(id)properties;

    Swift

    func beginEvent(withName name: String, identifier: String?, allowScreenshot: Bool, properties: Any!)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to create a unique key for the moment (can be nil).

    allowScreenshot

    A flag for whether to take a screenshot if the moment is late (defaults to YES).

    properties

    An optional dictionary containing metadata about the moment to be recorded (limited to 10 keys).

  • Starts recording data for an app moment with the provided name, optional identifier, screenshot flag, and optional key/value metadata

    Declaration

    Objective-C

    - (void)startMomentWithName:(nonnull NSString *)name
                     identifier:(nullable NSString *)identifier
                allowScreenshot:(BOOL)allowScreenshot
                     properties:(id)properties;

    Swift

    func startMoment(withName name: String, identifier: String?, allowScreenshot: Bool, properties: Any!)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to create a unique key for the moment (can be nil).

    allowScreenshot

    A flag for whether to take a screenshot if the moment is late (defaults to YES).

    properties

    An optional dictionary containing metadata about the moment to be recorded (limited to 10 keys).

  • Deprecated

    Please replace calls to end app moments with methods of the form endMomentWithName:

    Stops recording data for an app moment with the provided name.

    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

    Objective-C

    - (void)endEventWithName:(nonnull NSString *)name;

    Swift

    func endEvent(withName name: String)

    Parameters

    name

    The name used to identify the moment.

  • Stops recording data for an app moment with the provided name.

    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

    Objective-C

    - (void)endMomentWithName:(nonnull NSString *)name;

    Swift

    func endMoment(withName name: String)

    Parameters

    name

    The name used to identify the moment.

  • Stops recording data for an app moment with the provided name 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

    Objective-C

    - (void)endMomentWithName:(nonnull NSString *)name properties:(id)properties;

    Swift

    func endMoment(withName name: String, properties: Any!)

    Parameters

    name

    The name used to identify the moment.

    properties

    An optional dictionary containing metadata about the moment to be recorded (limited to 10 keys).

  • Deprecated

    Please replace calls to end app moments with methods of the form endMomentWithName:identifier:

    Stops recording data for an app moment with the provided name and identifier.

    The moment that has the given name, identifier pair will be marked as “completed.” If no moment is found with the given name AND identifier, this call will be ignored.

    Declaration

    Objective-C

    - (void)endEventWithName:(nonnull NSString *)name
                  identifier:(nullable NSString *)identifier;

    Swift

    func endEvent(withName name: String, identifier: String?)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to uniquely identify the moment.

  • Stops recording data for an app moment with the provided name and identifier.

    The moment that has the given name, identifier pair will be marked as “completed.” If no moment is found with the given name AND identifier, this call will be ignored.

    Declaration

    Objective-C

    - (void)endMomentWithName:(nonnull NSString *)name
                   identifier:(nullable NSString *)identifier;

    Swift

    func endMoment(withName name: String, identifier: String?)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to uniquely identify the moment.

  • Stops recording data for an app moment with the provided name and identifier, and adds properties to the moment.

    The moment that has the given name, identifier pair will be marked as “completed.” If no moment is found with the given name AND identifier, this call will be ignored.

    Declaration

    Objective-C

    - (void)endMomentWithName:(nonnull NSString *)name
                   identifier:(nullable NSString *)identifier
                   properties:(id)properties;

    Swift

    func endMoment(withName name: String, identifier: String?, properties: Any!)

    Parameters

    name

    The name used to identify the moment.

    identifier

    An identifier that is combined with the name to uniquely identify the moment.

    properties

    An optional dictionary containing metadata about the moment to be recorded (limited to 10 keys).

  • 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

    Objective-C

    - (_Bool)addSessionProperty:(nonnull NSString *)value
                        withKey:(nonnull NSString *)key
                      permanent:(BOOL)permanent;

    Swift

    func addSessionProperty(_ value: String, withKey key: String, permanent: Bool) -> Bool

    Parameters

    value

    The value to store for this property

    key

    The key for this property, must be unique within session properties

    permanent

    If true the property is applied to all sessions going forward, persist through app launches.

    Return Value

    A boolean indicating whether the property was added or not, see console log for details

  • Removes a property from the session. If that property was permanent then it is removed from all future sessions as well.

    Declaration

    Objective-C

    - (void)removeSessionPropertyWithKey:(nonnull NSString *)key;

    Swift

    func removeSessionProperty(withKey key: String)

    Parameters

    key

    The key for the property you wish to remove

  • Get a read-only representation of the currently set session properties. You can query and read from this representation however setting values in this object will not modify the actual properties in the session. To modify session properties see addSessionProperty.

    Properties are key-value pairs of NSString * objects.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)getSessionProperties;

    Swift

    func getSessionProperties() -> [AnyHashable : Any]
  • Embrace ships with automatic view capturing enabled. In this mode the SDK attempts to track and annotate all your view Presentations and logs them in the session. In complex apps, or apps with unconvential UI (spritekit, swiftui, react) automatic capture might be unreliable or too noisy to be useful

    For such apps we also provide a manual view annotation API. Using this API you decide when your app has entered and exited a view. Maybe you want to consolidate many views under a single header (i.e. “ProfileView”, instead of many individual labels).

    To use the API simply call “startViewWithName” whenever your app has entered a new view state and then call “endViewWithName” when the app exits that view state. View states stack up to 20 levels deep and view states automatically close on session end. This function will log a warning if you attempt to start a view that is already on the stack, or close a view that is not on the stack.

    Declaration

    Objective-C

    - (_Bool)startViewWithName:(nonnull NSString *)name;

    Swift

    func startView(withName name: String) -> Bool

    Parameters

    name

    The name for this view state

    Return Value

    a boolean indicating whether the operation was successful or not (see console log for reasoning)

  • See

    startViewWithName for full discussion of the manual view annotation system

    The endViewWithName function with close the view state for the specified view or log a warning if the view is not found

    Declaration

    Objective-C

    - (_Bool)endViewWithName:(nonnull NSString *)name;

    Swift

    func endView(withName name: String) -> Bool

    Parameters

    name

    The name for this view state

    Return Value

    a boolean indicating whether the operation was successful or not (see console log for reasoning)

  • Logs an event in your application for aggregation and debugging on the Embrace.io dashboard.

    Events are grouped by name and severity.

    Declaration

    Objective-C

    - (void)logMessage:(nonnull NSString *)name withSeverity:(id)severity;

    Swift

    func logMessage(_ name: String, withSeverity severity: Any!)

    Parameters

    name

    The name of the message, which is how it will show up on the dashboard

    severity

    Will flag the message as one of info, warning, or error for filtering on the dashboard

  • Logs an event in your application for aggregation and debugging on the Embrace.io dashboard with an optional dictionary of up to 10 properties.

    Declaration

    Objective-C

    - (void)logMessage:(nonnull NSString *)name
          withSeverity:(id)severity
            properties:(id)properties;

    Swift

    func logMessage(_ name: String, withSeverity severity: Any!, properties: Any!)

    Parameters

    name

    The name of the message, which is how it will show up on the dashboard

    severity

    Will flag the message as one of info, warning, or error for filtering on the dashboard

    properties

    An optional dictionary of up to 10 key/value pairs

  • 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

    Objective-C

    - (void)logMessage:(nonnull NSString *)name
          withSeverity:(id)severity
            properties:(id)properties
        takeScreenshot:(BOOL)takeScreenshot;

    Swift

    func logMessage(_ name: String, withSeverity severity: Any!, properties: Any!, takeScreenshot: Bool)

    Parameters

    name

    The name of the message, which is how it will show up on the dashboard

    severity

    Will flag the message as one of info, warning, or error for filtering on the dashboard

    properties

    An optional dictionary of up to 10 key/value pairs

    takeScreenshot

    A flag for whether the SDK should take a screenshot of the application window to display on the dashboard

  • Deprecated

    Please replace calls to log info messages with methods of the form logMessage:withSeverity:

    Logs an informative message to the Embrace.io API for aggregation and viewing on the dashboard.

    Declaration

    Objective-C

    - (void)logInfoMessage:(nonnull NSString *)message properties:(id)properties;

    Swift

    func logInfoMessage(_ message: String, properties: Any!)

    Parameters

    message

    The message used to find the log later, which is how it will be aggregated on the web dashboard

    properties

    An optional dictionary of custom key/value properties to be sent with the message

  • Deprecated

    Please replace calls to log warning messages with methods of the form logMessage:withSeverity:

    Logs a warning message to the Embrace.io API for aggregation and viewing on the dashboard. Unlike info messages, warning messages will be accompanied by a screenshot and stack trace. The screenshot can be disabled with the screenshot argument.

    Declaration

    Objective-C

    - (void)logWarningMessage:(nonnull NSString *)message
                   screenshot:(BOOL)screenshot
                   properties:(id)properties;

    Swift

    func logWarningMessage(_ message: String, screenshot: Bool, properties: Any!)

    Parameters

    message

    The message used to find the warning later, which will be combined with the stack trace to aggregate the logs on the dashboard view.

    screenshot

    A flag for whether to take a screenshot or not.

    properties

    An optional dictionary of custom key/value properties to be sent with the warning log.

  • Deprecated

    Please replace calls to log error messages with methods of the form logMessage:withSeverity:

    Logs an error message to the Embrace.io API for aggregation and viewing on the dashboard. Unlike info messages, error messages will be accompanied by a screenshot and stack trace. The screenshot can be disabled with the screenshot argument.

    Declaration

    Objective-C

    - (void)logErrorMessage:(nonnull NSString *)message
                 screenshot:(BOOL)screenshot
                 properties:(id)properties;

    Swift

    func logErrorMessage(_ message: String, screenshot: Bool, properties: Any!)

    Parameters

    message

    The message used to find the error later, which will be combined with the stack trace to aggregate the logs on the dashboard view.

    screenshot

    A flag for whether to take a screenshot or not.

    properties

    An optional dictionary of custom key/value properties to be sent with the error log.

  • Logs an Error or NSError object to the Embrace.io API for aggregation on the dashboard. These errors will be treated similarly to error log messages, but the serialization will be done by Embrace. During the serialization calls, the error description, reason, domain, and code will be logged as properties. As with error logs, a stack trace will be taken, and optional screenshots and error properties can be specified.

    Declaration

    Objective-C

    - (void)logHandledError:(nonnull NSError *)error
                 screenshot:(BOOL)screenshot
                 properties:(id)properties;

    Swift

    func logHandledError(_ error: Error, screenshot: Bool, properties: Any!)

    Parameters

    error

    The handled error object, which will be serialized and combined with the stack trace to aggregate the errors on the dashboard view.

    screenshot

    A flag for whether to take a screenshot or not.

    properties

    An optional dictionary of custom key/value properties to be sent with the error log.

  • Logs a handled exception to the Embrace.io API for aggregation and viewing on the dashboard. The log will include the stacktrace found on the exception.

    Declaration

    Objective-C

    - (void)logHandledException:(nonnull NSException *)exception
                   withSeverity:(id)severity;

    Swift

    func logHandledException(_ exception: NSException, withSeverity severity: Any!)

    Parameters

    exception

    The handled exception object, which will be serialized and combined with the stack trace to aggregate the errors on the dashboard view.

    severity

    Will flag the message as one of info, warning, or error for filtering on the dashboard

  • Logs a handled exception to the Embrace.io API for aggregation and viewing on the dashboard. The log will include the stacktrace found on the exception.

    Declaration

    Objective-C

    - (void)logHandledException:(nonnull NSException *)exception
                   withSeverity:(id)severity
               customStackTrace:(nonnull NSArray<NSString *> *)customStackTrace;

    Swift

    func logHandledException(_ exception: NSException, withSeverity severity: Any!, customStackTrace: [String])

    Parameters

    exception

    The handled exception object.

    severity

    Will flag the message as one of info, warning, or error for filtering on the dashboard

    customStackTrace

    A custom Stack Trace to be logged and displayed on the dashboard view.

  • Logs a handled exception to the Embrace.io API for aggregation and viewing on the dashboard. The log will include the stacktrace found on the exception.

    Declaration

    Objective-C

    - (void)logHandledException:(nonnull NSException *)exception
                   withSeverity:(id)severity
                     properties:(id)properties;

    Swift

    func logHandledException(_ exception: NSException, withSeverity severity: Any!, properties: Any!)

    Parameters

    exception

    The handled exception object, which will be serialized and combined with the stack trace to aggregate the errors on the dashboard view.

    severity

    Will flag the message as one of info, warning, or error for filtering on the dashboard

    properties

    An optional dictionary of custom key/value properties to be sent with the error log.

  • Logs a handled exception to the Embrace.io API for aggregation and viewing on the dashboard. The log will include the stacktrace found on the exception.

    Declaration

    Objective-C

    - (void)logHandledException:(nonnull NSException *)exception
                   withSeverity:(id)severity
                     properties:(id)properties
               customStackTrace:(nullable NSArray<NSString *> *)customStackTrace
                 takeScreenshot:(BOOL)takeScreenshot;

    Swift

    func logHandledException(_ exception: NSException, withSeverity severity: Any!, properties: Any!, customStackTrace: [String]?, takeScreenshot: Bool)

    Parameters

    exception

    The handled exception object, which will be serialized and combined with the stack trace to aggregate the errors on the dashboard view.

    severity

    Will flag the message as one of info, warning, or error for filtering on the dashboard

    properties

    An optional dictionary of custom key/value properties to be sent with the error log.

    customStackTrace

    A custom Stack Trace to be logged and displayed on the dashboard view. If this object is not nil, the Exception Stack Trace will be ignored.

    takeScreenshot

    A flag for whether the SDK should take a screenshot of the application window to display on the dashboard

  • Logs a custom message within this session for the Embrace dashboard to surface on the Session Timeline and within the Activity Log.

    This will NOT trigger an http request to the Embrace.io backend and is useful for adding additional context to the actions a user performed within a session. Good uses for breadcrumbs could be your app’s console error output or notes that significant events (add item to cart, start conversation, receive push notification) occurred.

    Declaration

    Objective-C

    - (void)logBreadcrumbWithMessage:(nonnull NSString *)message;

    Swift

    func logBreadcrumb(withMessage message: String)

    Parameters

    message

    The message that will be displayed within the session’s Activity Log on the dashboard.

  • Get the user identifier assigned to the device by Embrace

    Declaration

    Objective-C

    - (nullable NSString *)getDeviceId;

    Swift

    func getDeviceId() -> String?

    Return Value

    A device identifier created by Embrace

  • Associates the current app user with an internal identifier (e.g. your system’s uid) to be made searchable in the dashboard.

    Declaration

    Objective-C

    - (void)setUserIdentifier:(nonnull NSString *)userId;

    Swift

    func setUserIdentifier(_ userId: String)

    Parameters

    userId

    An internal identifier for the given user.

  • Resets the internal identifier for the current app user.

    Declaration

    Objective-C

    - (void)clearUserIdentifier;

    Swift

    func clearUserIdentifier()
  • Associates the current app user with a username to be made searchable in the dashboard.

    Declaration

    Objective-C

    - (void)setUsername:(nonnull NSString *)username;

    Swift

    func setUsername(_ username: String)

    Parameters

    username

    The current app user’s associated username.

  • Removes the username associated with the current app user.

    Declaration

    Objective-C

    - (void)clearUsername;

    Swift

    func clearUsername()
  • Associates the current app user with an email address to be made searchable in the dashboard.

    Declaration

    Objective-C

    - (void)setUserEmail:(nonnull NSString *)email;

    Swift

    func setUserEmail(_ email: String)

    Parameters

    email

    The current app user’s associated email address.

  • Removes the email address associated with the current app user.

    Declaration

    Objective-C

    - (void)clearUserEmail;

    Swift

    func clearUserEmail()
  • Marks the current app user as a paying user.

    This is used for cohorting and segmentation in the dashboard.

    Declaration

    Objective-C

    - (void)setUserAsPayer;

    Swift

    func setUserAsPayer()
  • Marks the current app user as a non-paying user (the default).

    Declaration

    Objective-C

    - (void)clearUserAsPayer;

    Swift

    func clearUserAsPayer()
  • Sets a custom persona for the current app user.

    Accepts string values to help you categorize and understand your users

    Declaration

    Objective-C

    - (void)setUserPersona:(nonnull NSString *)persona;

    Swift

    func setUserPersona(_ persona: String)
  • Removes the given custom persona for the current app user.

    Declaration

    Objective-C

    - (void)clearUserPersona:(nonnull NSString *)persona;

    Swift

    func clearUserPersona(_ persona: String)
  • Removes all custom personas for the current app user.

    Declaration

    Objective-C

    - (void)clearAllUserPersonas;

    Swift

    func clearAllUserPersonas()
  • Manually log a network request. In most cases the Embrace SDK automatically captures the details of your network requests.
    You can use this method to log any requests that the SDK is not capturing automatically.

    Declaration

    Objective-C

    - (void)logNetworkRequest:(id)request;

    Swift

    func logNetworkRequest(_ request: Any!)

    Parameters

    request

    An EMBNetworkRequest with at least the following set: url, method, start time, end time, and either status code or error.

  • Deprecated

    NSURLSessionTaskMetrics interactions are now recorded automatically by the SDK. This method will be removed in future versions.

    Logs enhanced metrics for a given URLSessionTask

    Declaration

    Objective-C

    - (void)logURLSessionTaskMetrics:(nullable NSURLSessionTaskMetrics *)metrics
                   forURLSessionTask:(nullable NSURLSessionTask *)task;

    Swift

    func logURLSessionTaskMetrics(_ metrics: URLSessionTaskMetrics?, for task: URLSessionTask?)
  • Deprecated

    WKWebView interactions are now recorded automatically by the SDK. This method will be removed in future versions.

    DEPRECATED

    Inform Embrace that a web view began a request that you’d like to have monitored. In order for data to be captured, ensure that you call logWebViewCompletedRequest: after the request is finished.

    Declaration

    Objective-C

    - (void)logWebViewBeganRequest:(nullable NSURLRequest *)request;

    Swift

    func logWebViewBeganRequest(_ request: URLRequest?)

    Parameters

    request

    The NSURLRequest whose performance you’d like to instrument.

  • Cause a crash. Use this for test purposes only

    Declaration

    Objective-C

    - (void)crash;

    Swift

    func crash()
  • Cause a crash with an exception. Use this for test purposes only

    Declaration

    Objective-C

    - (void)throwException;

    Swift

    func throwException()
  • Enables or disables embrace’s internal debug logging.

    Declaration

    Objective-C

    - (void)setDebuggingEnabled:(BOOL)enabled;

    Swift

    func setDebuggingEnabled(_ enabled: Bool)
  • Enables or disables embrace’s internal trace logging.

    Declaration

    Objective-C

    - (void)setTraceEnabled:(BOOL)enabled;

    Swift

    func setTraceEnabled(_ enabled: Bool)
  • Enables or disables embrace’s clean logging format

    Declaration

    Objective-C

    - (void)setCleanLogsEnabled:(BOOL)enabled;

    Swift

    func setCleanLogsEnabled(_ enabled: Bool)
  • Suspend coordinate capture

    Declaration

    Objective-C

    - (void)pauseTapCoordinateCapture;

    Swift

    func pauseTapCoordinateCapture()
  • Resume coordinate capture

    Declaration

    Objective-C

    - (void)resumeTapCoordinateCapture;

    Swift

    func resumeTapCoordinateCapture()
  • Suspend tap element capture

    Declaration

    Objective-C

    - (void)pauseTapElementCapture;

    Swift

    func pauseTapElementCapture()
  • Resume tap element capture

    Declaration

    Objective-C

    - (void)resumeTapElementCapture;

    Swift

    func resumeTapElementCapture()
  • Enables or disables background sessions

    Declaration

    Objective-C

    - (void)setBackgroundSessionMode:(id)mode;

    Swift

    func setBackgroundSessionMode(_ mode: Any!)
  • Enables or disables airplane mode

    Declaration

    Objective-C

    - (void)setAirplaneModeEnabled:(BOOL)enabled;

    Swift

    func setAirplaneModeEnabled(_ enabled: Bool)