@capacitor-community/appcenter-crashes
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published


App Center Crashes

@capacitor-community/appcenter-crashes

App Center Crashes will automatically generate a crash log every time your app crashes. The log is first written to the device's storage and when the user starts the app again, the crash report will be sent to App Center. Collecting crashes works for both beta and live apps, i.e. those submitted to the App Store. Crash logs contain valuable information for you to help fix the crash.

Maintainers

Maintainer GitHub Social
John Borges johnborges @johnborges

Features

  • Generate test crashes
  • Get more information about a previous crash
  • Customize how crashes are processed
  • Enable or disable App Center Crashes at runtime

Install

npm install @capacitor-community/appcenter-crashes
npx cap sync

API

isEnabled()

isEnabled() => Promise<{ value: boolean; }>

Check if Crashes is enabled or not.

Returns: Promise<{ value: boolean; }>

Since: 0.1.0


setEnabled(...)

setEnabled(options: { enable: boolean; }) => Promise<void>

You can enable and disable App Center Crashes at runtime. If you disable it, the SDK won't do any crash reporting for the app. The state is persisted in the device's storage across application launches.

Param Type
options { enable: boolean; }

Since: 0.1.1


generateTestCrash()

generateTestCrash() => Promise<void>

Generate a test crash for easy testing of the SDK. This API can only be used in test/beta apps and won't do anything in production apps.

Since: 0.2.0


hasReceivedMemoryWarningInLastSession()

hasReceivedMemoryWarningInLastSession() => Promise<{ value: boolean; }>

Check if app recieved memory warning in the last session.

Returns: Promise<{ value: boolean; }>

Since: 0.2.0


hasCrashedInLastSession()

hasCrashedInLastSession() => Promise<{ value: boolean; }>

Check if the app has crashed in the last session.

Returns: Promise<{ value: boolean; }>

Since: 0.3.0


lastSessionCrashReport()

lastSessionCrashReport() => Promise<{ value: ErrorReport; }>

Provides details about the crash that occurred in the last app session.

Returns: Promise<{ value: ErrorReport; }>

Since: 0.3.0


trackError(...)

trackError(errorModel: TrackableErrorModel) => Promise<{ value: string; }>

Track error

Param Type
errorModel TrackableErrorModel

Returns: Promise<{ value: string; }>

Since: 0.6.0


Interfaces

ErrorReport

Prop Type Description Since
id string UUID for the crash report.
threadName string Thread name that triggered the crash
appErrorTime string | number Date and time the error occurred. 0.7.3
appStartTime string | number Date and time the app started. 0.7.3
exceptionName string Exception name that triggered the crash.
exceptionReason string Exception reason.
device Device Device information of the app when it crashed.
signal string Signal that caused the crash.
appProcessIdentifier number Identifier of the app process that crashed.
stackTrace string The stack trace of the crash

Device

Prop Type Description
sdkName string Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android"
sdkVersion string Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1".
model string Device model (example: iPad2,3).
oemName string Device manufacturer (example: HTC).
osName string OS name (example: iOS).
osVersion string OS version (example: 9.3.0).
osBuild string OS build code (example: LMY47X).
osApiLevel number API level when applicable like in Android (example: 15).
locale string Language code (example: en_US).
timeZoneOffset number The offset in minutes from UTC for the device time zone, including daylight savings time.
screenSize string Screen size of the device in pixels (example: 640x480).
appVersion string Application version name, e.g. 1.1.0
carrierName string Carrier name (for mobile devices).
carrierCountry string Carrier country code (for mobile devices).
appBuild string The app's build number, e.g. 42.
appNamespace string The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example.

TrackableErrorModel

Prop Type
error ExceptionModelType
properties { [name: string]: string; }
attachments ErrorAttachmentLog[]

ExceptionModelType

Prop Type Description
wrapperSdkName string Name of the wrapper SDK. e.g 'appcenter.capacitor'
type string Exception type, e.g 'TypeException'
message string Exception message
stackTrace string Exception stacktrace

Package Sidebar

Install

npm i @capacitor-community/appcenter-crashes

Weekly Downloads

593

Version

4.0.0

License

MIT

Unpacked Size

95.2 kB

Total Files

30

Last publish

Collaborators

  • ionicjs
  • danielprrazevedo
  • nkalupahana
  • dtarnawsky
  • ryaa
  • dallasjames
  • tafelnl
  • thegnuu
  • pbowyer
  • capcombot
  • jcesarmobile
  • maxlynch
  • mhartington
  • dotnetkow
  • it_mike_s
  • byrds
  • rdlabo
  • priyankpatel
  • dwieeb
  • stewan
  • arielhernandezmusa
  • jeepq
  • start9keagan
  • boosten
  • nklayman
  • ihadeed
  • ckgaparajita
  • jpender
  • nhyatt
  • pwespi
  • epicshaggy
  • thomasvidas
  • robingenz
  • diachedelic
  • johnborges
  • tobyas
  • elylucas
  • larsmikkelsen
  • giodimiliaionic
  • brownoxford
  • mrbatista
  • bazuka5801
  • hemang