tencent cloud

Tencent Cloud Observability Platform

SDK Initialization

Download
Focus Mode
Font Size
Last updated: 2026-05-25 18:01:56
This article describes how to initialize the SDK.

Operation Steps

Refer to the following code to initialize the Terminal Performance Monitoring Pro (RUM Pro) SDK after the app launches. It is generally recommended to perform initialization in application:didFinishLaunchingWithOptions:delegate.
1. Import the corresponding header file in the AppDelegate implementation file.
#import <BuglyPro/Bugly.h>
#import <BuglyPro/BuglyConfig.h>
#import <BuglyPro/BuglyDefine.h>
2. Start the framework in didFinishLaunchingWithOptions.
// Creates a config object with the product's APP_ID and APP_KEY.
BuglyConfig *config = [[BuglyConfig alloc] initWithAppId:APP_ID appKey:APP_KEY];
// Required. Specifies the reporting domain type.
config.serverHostType = BuglyServerHostTypeCloud;
// Recommended. Specifies the build type. This field will be used in later configurations.
config.buildConfig = BuglyBuildConfigGray;
// Optional. Sets Bugly callbacks.
config.delegate = self;
// Sets device ID and user ID as early as possible.
config.deviceIdentifier = @"device_id";
config.userIdentifier = @"user_id";

NSArray *modules = @[BUGLY_MODULE_CRASH, RM_MODULE_LOOPER, RM_MODULE_MEMORY];
// NSArray *modules = RM_MODULE_ALL;
[Bugly start:modules config:config completeHandler:^{
// SDK initialization completion callback
}];
Note:
The device ID is critical because RUM Pro uses it to calculate the device exception rate. It is strongly recommended to set a correct device ID to ensure device uniqueness.
Performance monitoring items can be configured in Application Configuration > SDK Configuration by adjusting the device sampling rate to enable or disable specific performance monitoring features.
It is recommended to obtain user consent for the RUM Pro SDK Personal Information Protection Rules before initializing the SDK.



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback