Coding-free Integration of AppGallery Connect Crash into an iOS App

Creating Your Project and App

First, you need to create a project in AppGallery Connect and add an app to it. For details, see the AppGallery Connect documentation.

Enabling HUAWEI Analytics

The Crash service uses capabilities of HUAWEI Analytics when reporting crash events. Therefore, you must enable HUAWEI Analytics before integrating the Crash SDK. For details, please refer to the AppGallery Connect documentation.

Integrating SDKs

If you are using Xcode, you can integrate the Crash SDK into your Xcode project with CocoaPods.

cd project-directory
pod init
target 'demo' do
# Pods for demo
pod 'HiAnalytics'
pod 'AGConnectCrash'
end
end
pod install
#import   "AppDelegate.h"
#import <AGConnectCore/AGConnectCore.h>
#import <HiAnalytics/HiAnalytics.h>
@implementation AppDelegate
- (BOOL)Application:(UIApplication *)Application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after Application launch.
[AGCInstance startup];// Initialization
[HiAnalytics config];// Initialization
return YES;
}
...
@end

Testing the Crash Service

Create a test button makecrash in your demo project, and tap the button to trigger a crash. You can drag and drop the button for creating it, which is simple. The result is as follows.

Viewing a Crash Report

1. Sign in to AppGallery Connect, go to My projects, and find the app in which you triggered the crash.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store