-
public class NativeInterfaceUsed as the entry point for native code to allow proguard to obfuscate other areas if needed
-
-
Method Summary
Modifier and Type Method Description static ClientgetClient()static voidsetClient(@NonNull() Client client)Caches a client instance for responding to future events static EventcreateEmptyEvent()Create an empty Event for a "handled exception" report. static StringgetContext()static FilegetNativeReportPath()Retrieves the directory used to store native crash reports static Map<String, String>getUser()Retrieve user data from the static Client instance as a Map static Map<String, Object>getApp()Retrieve app data from the static Client instance as a Map static Map<String, Object>getDevice()Retrieve device data from the static Client instance as a Map static Array<String>getCpuAbi()Retrieve the CPU ABI(s) for the current device static Map<String, Object>getMetadata()Retrieves global metadata from the static Client instance as a Map static List<Breadcrumb>getBreadcrumbs()Retrieves a list of stored breadcrumbs from the static Client instance static voidsetUser(@Nullable() String id, @Nullable() String email, @Nullable() String name)Sets the user static voidsetUser(@Nullable() Array<byte> idBytes, @Nullable() Array<byte> emailBytes, @Nullable() Array<byte> nameBytes)Sets the user static voidleaveBreadcrumb(@NonNull() String name, @NonNull() BreadcrumbType type)Leave a "breadcrumb" log message static voidleaveBreadcrumb(@NonNull() Array<byte> nameBytes, @NonNull() BreadcrumbType type)Leave a "breadcrumb" log message static voidleaveBreadcrumb(@NonNull() String message, @NonNull() String type, @NonNull() Map<String, Object> metadata)Leaves a breadcrumb on the static client instance static voidclearMetadata(@NonNull() String section, @Nullable() String key)Remove metadata from subsequent exception reports static voidaddMetadata(@NonNull() String tab, @Nullable() String key, @Nullable() Object value)Add metadata to subsequent exception reports static voidaddMetadata(@NonNull() String tab, @NonNull() Map<String, out Object> metadata)Add metadata to subsequent exception reports with a Hashmap static StringgetReleaseStage()Return the client report release stage static StringgetSessionEndpoint()Return the client session endpoint static StringgetEndpoint()Return the client report endpoint static voidsetContext(@Nullable() String context)Set the client report context static voidsetBinaryArch(@NonNull() String binaryArch)Set the binary arch used in the application static StringgetAppVersion()Return the client report app version static Collection<String>getEnabledReleaseStages()Return which release stages notify static voidregisterSession(long startedAt, @Nullable() String sessionId, int unhandledCount, int handledCount)Update the current session with a given start time, ID, and event counts static booleanisDiscardErrorClass(@NonNull() String name)Ask if an error class is on the configurable discard list.This is used by the native layer to decide whether to pass an event todeliverReport() or not. static voiddeliverReport(@Nullable() Array<byte> releaseStageBytes, @NonNull() Array<byte> payloadBytes, @Nullable() Array<byte> staticDataBytes, @NonNull() String apiKey, boolean isLaunching)Deliver a report, serialized as an event JSON payload. static voiddeliverReport(@NonNull() File reportFile)Attempt to deliver an existing event file that is not current enqueued for delivery. static voidnotify(@NonNull() Array<byte> nameBytes, @NonNull() Array<byte> messageBytes, @NonNull() Severity severity, @NonNull() Array<StackTraceElement> stacktrace)Notifies using the Android SDK static voidnotify(@NonNull() String name, @NonNull() String message, @NonNull() Severity severity, @NonNull() Array<StackTraceElement> stacktrace)Notifies using the Android SDK static voidnotify(@NonNull() Array<byte> nameBytes, @NonNull() Array<byte> messageBytes, @NonNull() Severity severity, @NonNull() Array<NativeStackframe> stacktrace)Notifies using the Android SDK static voidnotify(@NonNull() String name, @NonNull() String message, @NonNull() Severity severity, @NonNull() Array<NativeStackframe> stacktrace)Notifies using the Android SDK static EventcreateEvent(@Nullable() Throwable exc, @NonNull() Client client, @NonNull() SeverityReason severityReason)Create an {@code Event}objectstatic LoggergetLogger()static voidsetAutoNotify(boolean autoNotify)Switches automatic error detection on/off after Bugsnag has initialized.This is required to support legacy functionality in Unity. static voidsetAutoDetectAnrs(boolean autoDetectAnrs)Switches automatic ANR detection on/off after Bugsnag has initialized.This is required to support legacy functionality in Unity. static voidstartSession()static voidpauseSession()static booleanresumeSession()static SessiongetCurrentSession()static voidmarkLaunchCompleted()Marks the launch period as complete static LastRunInfogetLastRunInfo()Get the last run info object static StringsetGroupingDiscriminator(@Nullable() String groupingDiscriminator)Set the Grouping Discriminator and return its previous value (if any). -
-
Method Detail
-
setClient
static void setClient(@NonNull() Client client)
Caches a client instance for responding to future events
-
createEmptyEvent
@NonNull() static Event createEmptyEvent()
Create an empty Event for a "handled exception" report. The returned Event will haveno Error objects, metadata, breadcrumbs, or feature flags. It's indented that the callerwill populate the Error and then pass the Event object to populateAndNotifyAndroidEvent.
-
getContext
@Nullable() static String getContext()
-
getNativeReportPath
@NonNull() static File getNativeReportPath()
Retrieves the directory used to store native crash reports
-
getUser
@NonNull() static Map<String, String> getUser()
Retrieve user data from the static Client instance as a Map
-
getApp
@NonNull() static Map<String, Object> getApp()
Retrieve app data from the static Client instance as a Map
-
getDevice
@NonNull() static Map<String, Object> getDevice()
Retrieve device data from the static Client instance as a Map
-
getCpuAbi
@NonNull() static Array<String> getCpuAbi()
Retrieve the CPU ABI(s) for the current device
-
getMetadata
@NonNull() static Map<String, Object> getMetadata()
Retrieves global metadata from the static Client instance as a Map
-
getBreadcrumbs
@NonNull() static List<Breadcrumb> getBreadcrumbs()
Retrieves a list of stored breadcrumbs from the static Client instance
-
setUser
static void setUser(@Nullable() String id, @Nullable() String email, @Nullable() String name)
Sets the user
- Parameters:
id- idemail- emailname- name
-
setUser
static void setUser(@Nullable() Array<byte> idBytes, @Nullable() Array<byte> emailBytes, @Nullable() Array<byte> nameBytes)
Sets the user
- Parameters:
idBytes- idemailBytes- emailnameBytes- name
-
leaveBreadcrumb
static void leaveBreadcrumb(@NonNull() String name, @NonNull() BreadcrumbType type)
Leave a "breadcrumb" log message
-
leaveBreadcrumb
static void leaveBreadcrumb(@NonNull() Array<byte> nameBytes, @NonNull() BreadcrumbType type)
Leave a "breadcrumb" log message
-
leaveBreadcrumb
static void leaveBreadcrumb(@NonNull() String message, @NonNull() String type, @NonNull() Map<String, Object> metadata)
Leaves a breadcrumb on the static client instance
-
clearMetadata
static void clearMetadata(@NonNull() String section, @Nullable() String key)
Remove metadata from subsequent exception reports
-
addMetadata
static void addMetadata(@NonNull() String tab, @Nullable() String key, @Nullable() Object value)
Add metadata to subsequent exception reports
-
addMetadata
static void addMetadata(@NonNull() String tab, @NonNull() Map<String, out Object> metadata)
Add metadata to subsequent exception reports with a Hashmap
-
getReleaseStage
@Nullable() static String getReleaseStage()
Return the client report release stage
-
getSessionEndpoint
@NonNull() static String getSessionEndpoint()
Return the client session endpoint
-
getEndpoint
@NonNull() static String getEndpoint()
Return the client report endpoint
-
setContext
static void setContext(@Nullable() String context)
Set the client report context
-
setBinaryArch
static void setBinaryArch(@NonNull() String binaryArch)
Set the binary arch used in the application
-
getAppVersion
@Nullable() static String getAppVersion()
Return the client report app version
-
getEnabledReleaseStages
@Nullable() static Collection<String> getEnabledReleaseStages()
Return which release stages notify
-
registerSession
static void registerSession(long startedAt, @Nullable() String sessionId, int unhandledCount, int handledCount)
Update the current session with a given start time, ID, and event counts
-
isDiscardErrorClass
static boolean isDiscardErrorClass(@NonNull() String name)
Ask if an error class is on the configurable discard list.This is used by the native layer to decide whether to pass an event todeliverReport() or not.
- Parameters:
name- The error class to ask about.
-
deliverReport
static void deliverReport(@Nullable() Array<byte> releaseStageBytes, @NonNull() Array<byte> payloadBytes, @Nullable() Array<byte> staticDataBytes, @NonNull() String apiKey, boolean isLaunching)
Deliver a report, serialized as an event JSON payload.
- Parameters:
releaseStageBytes- The release stage in which the event wascaptured.payloadBytes- The raw JSON payload of the eventapiKey- The apiKey for the eventisLaunching- whether the crash occurred when the app was launching
-
deliverReport
static void deliverReport(@NonNull() File reportFile)
Attempt to deliver an existing event file that is not current enqueued for delivery. Thefilename is expected to be in the standard EventFilenameInfo format, and the fileshould contain a correctly formatted Event object. This method will attempt tomove the file into place, and flush the queue asynchronously. If the file cannot be movedinto the queue directory, the file is deleted before returning.
- Parameters:
reportFile- the file to enqueue for delivery
-
notify
static void notify(@NonNull() Array<byte> nameBytes, @NonNull() Array<byte> messageBytes, @NonNull() Severity severity, @NonNull() Array<StackTraceElement> stacktrace)
Notifies using the Android SDK
- Parameters:
nameBytes- the error namemessageBytes- the error messageseverity- the error severitystacktrace- a stacktrace
-
notify
static void notify(@NonNull() String name, @NonNull() String message, @NonNull() Severity severity, @NonNull() Array<StackTraceElement> stacktrace)
Notifies using the Android SDK
- Parameters:
name- the error namemessage- the error messageseverity- the error severitystacktrace- a stacktrace
-
notify
static void notify(@NonNull() Array<byte> nameBytes, @NonNull() Array<byte> messageBytes, @NonNull() Severity severity, @NonNull() Array<NativeStackframe> stacktrace)
Notifies using the Android SDK
- Parameters:
nameBytes- the error namemessageBytes- the error messageseverity- the error severitystacktrace- a stacktrace
-
notify
static void notify(@NonNull() String name, @NonNull() String message, @NonNull() Severity severity, @NonNull() Array<NativeStackframe> stacktrace)
Notifies using the Android SDK
- Parameters:
name- the error namemessage- the error messageseverity- the error severitystacktrace- a stacktrace
-
createEvent
@NonNull() static Event createEvent(@Nullable() Throwable exc, @NonNull() Client client, @NonNull() SeverityReason severityReason)
Create an
{@code Event}object- Parameters:
exc- the Throwable object that caused the eventclient- the Client object that the event is associated withseverityReason- the severity of the Event
-
setAutoNotify
static void setAutoNotify(boolean autoNotify)
Switches automatic error detection on/off after Bugsnag has initialized.This is required to support legacy functionality in Unity.
- Parameters:
autoNotify- whether errors should be automatically detected.
-
setAutoDetectAnrs
static void setAutoDetectAnrs(boolean autoDetectAnrs)
Switches automatic ANR detection on/off after Bugsnag has initialized.This is required to support legacy functionality in Unity.
- Parameters:
autoDetectAnrs- whether ANRs should be automatically detected.
-
startSession
static void startSession()
-
pauseSession
static void pauseSession()
-
resumeSession
static boolean resumeSession()
-
getCurrentSession
@Nullable() static Session getCurrentSession()
-
markLaunchCompleted
static void markLaunchCompleted()
Marks the launch period as complete
-
getLastRunInfo
@Nullable() static LastRunInfo getLastRunInfo()
Get the last run info object
-
setGroupingDiscriminator
@Nullable() static String setGroupingDiscriminator(@Nullable() String groupingDiscriminator)
Set the Grouping Discriminator and return its previous value (if any).
-
-
-
-