macOS SDK compliance
Compliance Statement
MIIT compliance requires that apps cannot obtain any personal information before the user agrees to the privacy policy. Therefore, you need to obtain the user's consent by popping up the "Privacy Policy" when your app is launched for the first time.
You must inform your users that your APP integrates the QuickTracking SDK service and add the following reference terms to the Privacy Policy:
Our product integration Quick Tracking SDK,Quick Tracking SDK need to collect your OS/OSVERSION/TIMEZONE/LANGUAGE/RESOLUTION /device manufacturer /device model /device brand /network to provide statistical analysis services.
Make sure that your users agree to the Privacy Policy before initializing the QuickTracking SDK. Otherwise, if the users do not agree to the Privacy Policy, they cannot initialize the QuickTracking SDK.
Initialize the SDK
Note: You must initialize the SDK in the main thread of the program entry. Otherwise, some event data may be lost.
Obtain the appkey
When you initialize the SDK, you must specify the appkey parameter. The appkey is the unique ID of the application in QuickTracking. It is generated when you create an application. For more information about how to obtain or view the appkey, see Application management.
Obtain the domain name of a receipt
The collection domain name is the domain name server address for SDK reporting logs, which is obtained from "QuickTracking Management Background-Management Console-Collect Information-Collection Domain Name"
Initialize the SDK
#import <QuickTrackingSDK/QuickTrackingSDK.h>
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
QTSDKConfig *sdkConfig;
// Initialize the SDK configuration.
sdkConfig = [[QTSDKConfig alloc] initWithAppkey:@"The unique identifier of your application"
trackDomain:@"https:// Your domain name"
launchOptions:nil];
// Specify the channel in which the application is published. Example: appstore.
sdkConfig.channel = @"Your application release channel";
// Set the minimum interval (in milliseconds) for batch sending. Default value: 3s.
sdkConfig.batchSendInterval = 3000;
// Enable the SDK log printing, which is disabled by default.
sdkConfig.enableLog = YES;
// Ensure that the SDK is not disabled. The default value is NO.
// sdkConfig.disableSDK = NO;
// Wait for the data sending result when the app enters the background. The default value is NO.
// sdkConfig.enableSendLogsBeforeEnterBackground = YES;
// "QuickTracking management background -- data collection -- tracking verification -- PC application verification"
// sdkConfig.debugKey = @"97052112091876_xxxxx";
// Set the maximum number of local cache events. The default value is 10000. If the number of local cache events exceeds the limit, some events are deleted.
// sdkConfig.maxCacheSize = 10000;
// Specifies whether to enable H5 bridge event listening. By default, H5 bridge event listening is disabled.
// sdkConfig.enableJSBridge = YES;
// Initialize the SDK.
[QuickTrackingSDK initWithConfig:sdkConfig];
}QTSDKConfig parameter description
Parameter | type | Description | Required |
appkey | nonnull NSString | The unique encoding of the application, that is, the appkey of the application. | Yes |
trackDomain | nonnull NSString | The domain name of the data collection, which is used to determine the destination of the data sent. | Yes |
launchOptions | nullable id | Startup options, which typically contain configuration properties (which can be nil) when the application starts. | No |
QTSDKConfig property list
Parameter | type | Description | Required |
batchSendInterval | NSInteger | The minimum time interval between two data transmissions, in milliseconds. The default value is 3 seconds. The minimum value is 3 seconds. | No |
maxCacheSize | NSInteger | The maximum number of local cache events. The default value is 10000. If the number of events exceeds the limit, some events are deleted. | No |
batchSendQueueSize | NSInteger | The maximum number of cached logs that can be uploaded. Default value: 100. If you set this parameter to a large value, network request packet loss may occur. | No |
enableLog | BOOL | Whether to enable log printing. The default value is NO. | No |
disableSDK | BOOL | Whether to disable the SDK. Default value: NO. After you disable the SDK, the SDK does not trigger events and does not send network requests. | No |
enableSendLogsBeforeEnterBackground | BOOL | Whether to wait for the data sending result when the app enters the background. The default value is NO. If you set YES, the system waits for the data sending result. | No |
cacheFilePath | NSString | The path where the custom tracking data is stored. This path applies only to the macOS development environment. | No |
channel | NSString | The release channel of the application. It is used to identify the release channel of the application. | No |
debugKey | NSString | The tracking point verification identifier is used to provide a confirmation identifier in the verification data flow process. | No |
enableJSBridge | Boolean | H5 bridge switch, used to listen to H5 bridge events, disabled by default | No |