Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

App Center Crashes

Improve this doc

App Center Analytics helps you understand user behavior and customer engagement to improve your app. The SDK automatically captures session count and device properties like model, OS version, etc. You can define your own custom events to measure things that matter to you. All the information captured is available in the App Center portal for you to analyze the data.

For more info, please see https://docs.microsoft.com/en-us/appcenter/sdk/crashes/cordova

Repo: https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-crashes

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-appcenter-crashes
    $ npm install --save @ionic-native/app-center-crashes@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { AppCenterCrashes } from '@ionic-native/app-center-crashes';


constructor(private AppCenterCrashes: AppCenterCrashes) { }

...

this.AppCenterCrashes.setEnabled(true).then(() => {
   this.AppCenterCrashes.lastSessionCrashReport().then(report => {
       console.log('Crash report', report);
   });
});

Instance Members

generateTestCrash()

App Center Crashes provides you with an API to 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.

Returns: void

hasCrashedInLastSession()

At any time after starting the SDK, you can check if the app crashed in the previous launch

Returns: Promise<boolean>

lastSessionCrashReport()

Details about the last crash

Returns: Promise<AppCenterCrashReport>

isEnabled()

Check if App Center Crashes is enabled

Returns: Promise<boolean>

setEnabled(shouldEnable)

Enable or disable App Center Crashes at runtime

Param Type Details
shouldEnable boolean

Set value

Returns: Promise<void>

AppCenterCrashReport

Param Type Details
id string
device AppCenterCrashReportDevice
appStartTime number
appErrorTime number
signal string
appProcessIdentifier number

AppCenterCrashReportDevice

Param Type Details
oem_name string
os_name string
app_version string
time_zone_offset number
carrier_name string
screen_size string
locale string
sdk_version string
carrier_country string
os_build string
app_namespace string
os_version string
sdk_name string
model string
app_build string

API

Native

General