1. Compliance initialization
1.1 Initialization Interface
1. Compliance Statement
The MIIT compliance requirement requires that applications cannot obtain any personal information before users agree to the privacy policy. Therefore, Quick Tracking is initialized to perform the following operations:
You need to ensure that the application has a "privacy policy", and when the user installs or first starts the application, the "privacy policy" pops up to obtain user consent.
You must inform the user that you choose to Quick Tracking SDK the service, please in the privacy policy to add the following reference terms:
"" to our product integration Quick Tracking SDK,Quick Tracking SDK need to collect your OS/OSVERSION/MEMORY/MAC/CPU/TIMEZONE/LANGUAGE/RESOLUTION /device manufacturer /device model to provide statistical analysis service.
2. Initialize compliance
To ensure that your application can meet the compliance requirements of the Ministry of Industry and Information Technology (MIIT) after the [Quick Tracking] statistics SDK is integrated, you must make sure that the application calls the formal initialization function to initialize the statistics SDK after the user reads your privacy policy and obtains the user's authorization. In this case, the SDK collects device information and reports data. Conversely, if the user does not agree with the Privacy Policy authorization, the initialization function cannot be called.
/**Initialize Quick Tracking for all component products
* The param parameter needs to be serialized using the QT::Helper::QT_Serializable method provided by QTOrPCHelper.
*/
QTFORPC_API QT_VOID initQTPC(QT_CSTR strAppKey, QT_CSTR strProcessName, QT_CSTR strTrackDomain, QT_MAP param);Parameters | Type | Description | Required |
strAppKey | const char * | QT is a unique identifier issued by the current application platform. | Yes |
strProcessName | const char * | The name of the application process. | Yes |
strTrackDomain | const char * | Address of the primary domain name for log upload +"/event" | Yes |
param | const char * | For other configuration parameters, the input parameter must be in the form of a map collection, and then call QT::Helper::QT_Serializable serialization.
| No |
Example:
QT_INTERFACE_PTR qtInterface = NULL;
try
{
qtInterface = loadQTDLL(L"QTForPC.dll");
if (!qtInterface)
{
fprintf(stderr, "Error loading dll: %lx\n", -1);
return -1;
}
std::map<string, string> param;
param["appVersion"] = "testVersion";
param["channel"] = "testChannel";
param["maxCacheDay"] = "60";
param["maxReportDataSize"] = "100";
std::string sparam;
QT::Helper::QT_Serializable(sparam, param);
qtInterface->initQTPC("appKey", "processname", "http://xxxxx/event", sparam.c_str());
......
}
catch (...)
{
return -1;
}
system("pause");
freeQTDLL(qtInterface);1.2 Appkey acquisition
When you initialize the SDK, you must specify the AppKey parameter. An AppKey is the unique ID of an application in Quick Tracking. It is generated when you create an application. For more information about how to obtain or view an AppKey, see Application management.
2-day log printing
You can call the QtConfigure.setLogEnabled(true) operation to control the output of [Quick Tracking] logs.
// Print logs.
// LOG_PRINT_TYPE_NONE: None
// LOG_PRINT_TYPE_STDOUT: stdout
// LOG_PRINT_TYPE_FILE: file output, the output directory is %appdata%/qtforpc/appkey/
QTFORPC_API QT_VOID setQTLog(QT_CSTR strAppKey, QT_CSTR strProcessName, LOG_PRINT_TYPE type);Parameters | Type | Description | Required |
strAppKey | const char * | QT is a unique identifier issued by the current application platform. | Yes |
strProcessName | const char * | The name of the application process. | Yes |
type | enum LOG_PRINT_TYPE | The log output mode.
| Yes |
Note:
You must call the setQTLog operation to enable the logging feature before you call the initQTPC operation.
Example:
// Print logs.
qtInterface->setQTLog("appKey", "processname", LOG_PRINT_TYPE::LOG_PRINT_TYPE_FILE);
// Initialize
qtInterface->initQTPC("appKey", "processname", "http://xxxxx/event", sparam.c_str());3-day Logo Sending Policy
Quick Tracking Windows SDK default event reporting policy is:
Normal request logs aggregate report. The default value is 300. You can call the initQTPC operation to set the aggregate size by using maxReportDataSize parameters.
request logs sent at an interval of 3s