@capacitor-community/appcenter-crashes

Capacitor plugin for Microsoft's App Center Crashes

Usage no npm install needed!

<script type="module">
  import capacitorCommunityAppcenterCrashes from 'https://cdn.skypack.dev/@capacitor-community/appcenter-crashes';
</script>

README


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: { shouldEnable: 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 { shouldEnable: boolean; }

Since: 0.1.0


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


Interfaces

ErrorReport

Prop Type Description
id string UUID for the crash report.
threadName string
appErrorTime string | number Date and time the error occurred.
appStartTime string | number Date and time the app started.
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.

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.