The huawei AGC crash service supports cross-platform integration. According to the documents and my own integration experience, the operation is very simple. It is really zero code. Developers who need to integrate can follow the steps or download the Demo study themselves.

The integration steps

  1. Install the Cordova environment

npm install -g cordova

  1. Open service & create project

A) Create Android applications in AGC and open crash service, and open Huawei analysis service simultaneously

Cordova create cordovaproject com.huawei.cordovacrash cordovacrash Cordovaproject indicates the project name com.huawei. cordovacrash indicates the application package name cordovacrash indicates the application name

C) Required platforms Go to the project directory and run cordova Platform ls to view supported platforms

Run cordova Platform add Android to add an Android platform

Look again at the platforms you have added

D) Place agconnect-services.json file in android/app directory

E) Install AGC cordova plugin add @cordova-plugin-agconnect/crash

Once installed, you can see it in plugins

Add the plugin address to app/build.gradle

  1. Testing capabilities

You can set three buttons, two to control whether a crash report is reported, and the other to call setUserId to set a customized user ID, setCustomKey to set a customized key-value pair, LogLevel, and testIt to create a crash.

  1. Compilation and Installation

Run the Cordova Build Android compilation project

Run Cordova Run Android to install APK

Crash Report View

After integration, click the button to create a crash and generate a custom report, which can be viewed on the AGC page.

2. View the crash details stack

3. View custom key-value pairs

4. View the custom log level

5. View the custom user ID

For more details, please refer to: 1, the collapse of the huawei AGC service document: developer.huawei.com/consumer/cn…

2, the collapse of the AGC – huawei service codelab:developer.huawei.com/consumer/cn…

3, the collapse of the AGC – huawei service Demo (cordova) : developer.huawei.com/consumer/cn…


The original link: developer.huawei.com/consumer/cn…

Original author: Mayism