RNEmbrace

@interface RNEmbrace : NSObject

Entry point for the Embrace ReactNative SDK.

  • Returns the shared RNEmbrace singleton object.

    Declaration

    Objective-C

    + (nonnull instancetype)sharedInstance;

    Swift

    class func sharedInstance() -> Self
  • Logs a javascript unhandled exception.

    Declaration

    Objective-C

    - (void)logUnhandledJSException:(nullable NSString *)name
                            message:(nullable NSString *)message
                               type:(nullable NSString *)type
                         stackTrace:(nullable NSString *)stackTrace;

    Swift

    func logUnhandledJSException(_ name: String?, message: String?, type: String?, stackTrace: String?)

    Parameters

    name

    name of the exception.

    message

    exception message.

    type

    error type.

    stackTrace

    exception stacktrace.

  • Sets the react native version number.

    Declaration

    Objective-C

    - (void)setReactNativeVersion:(nullable NSString *)version;

    Swift

    func setReactNativeVersion(_ version: String?)

    Parameters

    version

    react native version number.

  • Sets javascript patch number.

    Declaration

    Objective-C

    - (void)setJavaScriptPatchNumber:(nullable NSString *)number;

    Swift

    func setJavaScriptPatchNumber(_ number: String?)

    Parameters

    number

    javascript patch number.

  • Sets the path of the javascript bundle.

    Declaration

    Objective-C

    - (void)setJavaScriptBundleURL:(nullable NSString *)url;

    Swift

    func setJavaScriptBundleURL(_ url: String?)

    Parameters

    url

    path of the javascript bundle.

  • Log a ReactNative exception through the native embrace sdk.

    Declaration

    Objective-C

    - (void)logMessage:(nullable NSString *)name
          withSeverity:(EMBSeverity)severity
            properties:(nullable NSDictionary *)properties
        takeScreenshot:(BOOL)takeScreenshot
          jsStackTrace:(nullable NSString *)jsStackTrace;

    Swift

    func logMessage(_ name: String?, withSeverity severity: Any!, properties: [AnyHashable : Any]?, takeScreenshot: Bool, jsStackTrace: String?)

    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

    jsStackTrace

    javascript stack trace coming from the the ReactNative side

  • Log a ReactNative exception through the native embrace sdk.

    Declaration

    Objective-C

    - (void)logMessage:(nullable NSString *)name
          withSeverity:(EMBSeverity)severity
            properties:(nullable NSDictionary *)properties
        takeScreenshot:(BOOL)takeScreenshot
          jsStackTrace:(nullable NSString *)jsStackTrace
            wasHandled:(BOOL)wasHandled;

    Swift

    func logMessage(_ name: String?, withSeverity severity: Any!, properties: [AnyHashable : Any]?, takeScreenshot: Bool, jsStackTrace: String?, wasHandled: 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

    jsStackTrace

    javascript stack trace coming from the the ReactNative side

    wasHandled

    mark it as handled or not