Quick Start¶
This document provides the shortest path to integrate the UniApp RUM SDK, helping you complete a verifiable data reporting with minimal steps.
Prerequisites¶
Before starting, please complete the following preparations:
- Create UniApp Android and UniApp iOS applications in RUM respectively, and obtain their respective
RUM App ID. - Confirm the reporting address and authentication method:
- Local environment deployment: Prepare
datakitUrl. - Public DataWay: Prepare
datawayUrlandclientToken. - Download datakit-uniapp-native-plugin, and prepare
GCUniPluginandGC-JSPlugin.
Integration Steps¶
- Copy
GCUniPluginto the project'snativeplugins, and enable the local plugin inmanifest.json. - Copy
GC-JSPluginto the project'suni_modules. - Call
sdkConfiginApp.vueto complete SDK initialization. - Call
rum.setConfigto configure theApp IDfor Android and iOS. - If automatic collection of Views, errors, or requests is needed, then integrate the corresponding capabilities from
GC-JSPlugin. - Enable
debug, run the application, and verify if data is reported successfully.
Minimal Initialization Example¶
<script>
var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
var rum = uni.requireNativePlugin("GCUniPlugin-RUM");
export default {
onLaunch: function() {
ftModule.sdkConfig({
datawayUrl: "https://open.dataway.url",
clientToken: "client-token",
debug: true,
env: "common"
});
rum.setConfig({
androidAppId: "YOUR_ANDROID_APP_ID",
iOSAppId: "YOUR_IOS_APP_ID"
});
}
}
</script>
Automatic View Collection Example¶
Verify Integration Success¶
- Keep
debug: trueenabled and run the application. - Open a View, or initiate a network request via
gcRequest.request. - Confirm in the debugging environment that the SDK initialization and data synchronization logs are output normally.
- Return to the console and confirm that RUM data for the corresponding platform has appeared in the application.
Next Steps¶
- For complete installation methods and FAQ, continue reading Application Access.
- For SDK initialization parameter descriptions, read SDK Initialization.
- For detailed configurations of RUM, Log, and Trace, read RUM Configuration, Log Configuration, Trace Configuration.
- For custom tags, collection rules, or data masking capabilities, read the corresponding advanced topics.