tencent cloud

Tencent Cloud Super App as a Service

Release Notes and Announcements
Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Pay-As-You-Go Billing
Renewal Guide
Service Suspension Instructions
Getting Started
Plan Management
Overview
Console Account Management
Storage Configuration
Acceleration Configuration
Branding Configurations
Platform Features
Console Login
Users and Permission System
Mini Program Management
Mini Game Management
Superapp Management
Commercialization
Platform Management
User Management
Team Management
Operations Management
Security Center
Code Integration Guide
Getting Demo and SDK
Android
iOS
Flutter
Superapp Server
GUID Generation Rules
Mini Program Development Guide
Mini Program Introduction and Development Environment
Mini Program Code Composition
Guide
Framework
Components
API
Server Backend
JS SDK
Base Library
IDE Operation Instructions
Mini Game Development Guide
Guide
API
Server Backend
Practice Tutorial
Mini Program Login Practical Tutorial
Mini Program Subscription Message Practical Tutorial
Payment Practical Tutorial
Ad Integration Practical Tutorial
Mini Game Subscription Message Practical Tutorial
API Documentation
History
Introduction
API Category
Making API Requests
Operation Management APIs
User Management APIs
Team Management APIs
Sensitive API-Related APIs
Role Management APIs
Platform Management APIs
Other Console APIs
Mini Program or Mini Game APIs
Management-Sensitive APIs
Global Domain Management APIs
Superapp APIs
Data Types
Agreements
Service Level Agreement
Data Processing and Security Agreement
SDK Privacy Policy Module
SDK Data Processing and Security Agreement Module

Logging and Event Reporting

PDF
Focus Mode
Font Size
Last updated: 2025-03-17 15:45:40

SDK runtime log printing

Implement the log output API during the development phase to facilitate troubleshooting.
Note:
It is recommended to disable log output when the app is released to ensure security and performance.
/// Print log
/// @param level Log level. For more information, see `PLTLogLevel`.
/// @param msg Log message
- (void)log:(MALogLevel)level msg:(NSString *)msg;

Reporting the event

The host app can implement the event reporting API to override the internal reporting logic of the SDK.
This includes mini program operation events and data reported by the mini program's internal wx.reportEvent.
typedef NS_ENUM(NSInteger,TMAReportEventID){.
// undefined, report user-defined events
// undefined, report user-defined event
TMAReportEventID_None = 0,
// Open the mini program.
// Open the mini program.
TMAReportEventID_OPEN_MINIAPP = 1,
// update the mini program
// Update the mini program.
TMAReportEventID_UPDATE_MINIAPP = 2,
// Download the mini program.
// Download the mini program.
TMAReportEventID_DOWNLOAD_MINIAPP = 3,
// Open the mini program page.
// Open the mini program page.
TMAReportEventID_MINIAPP_PAGE_VIEW = 4,
// Exit the mini program.
// close the mini program
TMAReportEventID_EXIT_MINIAPP = 5,
// mini program behaviour event, atcion:0 background; 1 foreground
// mini program behaviour event, atcion: 0 onHide; 1 onShow
TMAReportEventID_MINIAPP_ACTION = 6
};

// Upload data - report data
// @param event event, refer to TMAReportEventID - event ID, refer to TMAReportEventID
// @param eventName eventName - the name of the event
// @param params params - Parameters
// @param appInfo appletInfo - information about the mini program
// @return Whether to intercept internal reporting - Whether to intercept internal reporting
- (BOOL)reportEvent:(int)eventId
eventName:(NSString *)eventName
params:(NSDictionary *)params
appinfo:(TMFMiniAppInfo *)appInfo;

Real-time log reporting for mini programs

The host app can implement an event realtime log reporting interface to override the reporting logic inside the SDK.
Including the log data written by calling wx.getRealtimeLogManager inside the mini program.
// Report log data - Report log data
// @param appId appID
// @param jsVersion base library version - base library version
// @param page current page - Current page
// @param filterMsgs Filtered Content - Filtered Content
// @param logs log events - log events
// @param completionBlock - The result of the callback.
// @return Whether to block internal reporting - Whether to block internal reporting
- (BOOL)reportRealTimeLogWithAppId:(NSString *)appId
jsVersion:(NSString *)jsVersion
page:(NSString *)page
filterMsgs:(NSArray <NSString *>*)filterMsgs
logs:(NSArray <TMARealtimeLogItem *>*)logs
completionBlock:(void (^)(NSError * _Nullable error))completionBlock;




Internal log reporting for mini programs

The host app can implement event real-time log reporting interface to override the reporting logic inside the SDK.
Including the log data written by wx.getLogManager within the mini program, and the user can upload the printed log by using the open-type="feedback" of the button component.// Upload the logs of the mini program corresponding to the appID - Upload the logs of the mini program corresponding to the appID
// Upload the logs of the mini program corresponding to the appID - Upload the logs of the mini program corresponding to the appID
// Implemented using TMFMiniAppSDKManager's `sandBoxPathWithAppID:` interface to get the sandbox path, then splice `usr/miniprogramLog/` to get it - Implemented using TMFMiniAppSDKManager's `sandBoxPathWithAppID:` interface to get the sandbox path, then splice `usr/miniprogramLog/` to get it - Implemented using TMFMiniAppSDKManager's ` sandBoxPathWithAppID: TMFMiniAppSDKManager's `sandBoxPathWithAppID:` interface to get the sandbox path, then splice `usr/miniprogramLog/` to get it.
// @param appID appID of the mini program - appID of the applet/game.

- (void)uploadLogFileWithAppID:(NSString *)appID;


Help and Support

Was this page helpful?

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

Feedback