Skip to content

UniApp Application Integration


Prerequisites

Note: If you have enabled the RUM Headless service, the prerequisites have been automatically configured for you, and you can directly integrate the application.

Application Integration

  1. Go to User Access Monitoring > Create Application > Android/iOS;
  2. Create two applications for UniApp Android and UniApp iOS respectively to receive RUM data from the Android and iOS platforms;
  3. Enter the corresponding application name and application ID for each platform's application;
  4. Choose the application integration method:
    • Public DataWay: Directly receives RUM data without installing the DataKit collector.
    • Local Environment Deployment: Receives RUM data after meeting the prerequisites.

Installation

Local Usage

Source Code: https://github.com/GuanceCloud/datakit-uniapp-native-plugin

Demo: https://github.com/GuanceCloud/datakit-uniapp-native-plugin/Hbuilder_Example

Explanation of the downloaded SDK package structure:

|--datakit-uniapp-native-plugin
  |-- Hbuilder_Example            // Example project for GCUniPlugin
      |-- nativeplugins           // Local plugin folder for the example project
          |-- GCUniPlugin         // ⭐️ GCUniPlugin Native Plugin ⭐️
          |   |-- android         // Contains dependency libraries and resource files for the Android plugin
          |   |-- ios             // Contains dependency libraries and resource files for the iOS plugin
          |   |-- package.json    // Plugin configuration file
      |-- GCPageMixin.js          // JS for automatic view capture, used in conjunction with GCWatchRouter.js
      |-- GCWatchRouter.js        // JS for automatic view capture, used in conjunction with GCPageMixin.js
      |-- GCPageViewMixinOnly.js  // JS for automatic view capture, used alone
      |-- GCRequest.js            // JS for resource and trace, providing APM and network request monitoring capabilities
  |-- UniPlugin-Android           // Main project for Android plugin development
  |-- UniPlugin-iOS               // Main project for iOS plugin development

Configure the GCUniPlugin folder in the "nativeplugins" directory of your uni_app project. Also, in the "App Native Plugin Configuration" section of the manifest.json file, click "Select Local Plugin" and choose the GCUniPlugin plugin from the list:

img

Note: After saving, you need to submit a cloud build (creating a Custom Playground also counts as a cloud build) for the plugin to take effect.

For more details, refer to: Using Local Plugins in HBuilderX, Custom Playground

Marketplace Plugin Method

(Not provided)

Uni Mini Program SDK Installation

Development Debugging and wgt Release Usage

  • When developing and debugging the uni mini program SDK, you need to integrate GCUniPlugin using the Local Usage method.

  • When the uni mini program SDK is packaged into a wgt package for use by the host App, the host App needs to import the GCUniPlugin dependency libraries (including the Native SDK libraries) and register the GCUniPlugin Module.

Operations required by the host App:

iOS

  • Add GCUniPlugin dependency libraries

    In the Xcode project, select the project name in the left directory, click the "+" button in TARGETS -> Build Phases -> Link Binary With Libaries, then click Add Other -> Add Files..., open the GCUniPlugin/ios/ dependency library directory, select FTMobileSDK.xcframework and GC_UniPlugin_App.xcframework in the directory, and click open to add the dependency libraries to the project.

    When SDK Version < 0.2.0: In TARGETS -> General -> Frameworks,Libaries,and Embedded Content, find FTMobileSDK.xcframework and change the Embed method to Embed & sign.

  • Register GCUniPlugin Module:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ....
      //  Register GCUniPlugin module
    [WXSDKEngine registerModule:@"GCUniPlugin-MobileAgent" withClass:NSClassFromString(@"FTMobileUniModule")];
    [WXSDKEngine registerModule:@"GCUniPlugin-RUM" withClass:NSClassFromString(@"FTRUMModule")];
    [WXSDKEngine registerModule:@"GCUniPlugin-Logger" withClass:NSClassFromString(@"FTLogModule")];
    [WXSDKEngine registerModule:@"GCUniPlugin-Tracer" withClass:NSClassFromString(@"FTTracerModule")];  
      return YES;
    }

Android

  • Add GCUniPlugin dependency libraries

  • Method 1: Add ft-native-[version].aar, ft-sdk-[version].aar, and gc-uniplugin-[last-version].aar from the GCUniPlugin/android/ folder to the libs folder of the project, and modify the build.gradle file to add dependencies.

  • Method 2: Use the Gradle Maven remote repository for configuration. Refer to the UniAndroid-Plugin project configuration for the configuration method.
  dependencies {
      implementation files('libs/ft-native-[version].aar')
      implementation files('libs/ft-sdk-[version].aar')
      implementation files('libs/gc-uniplugin-[last-version].aar')
      implementation 'com.google.code.gson:gson:2.8.5'
  }   
  • Register GCUniPlugin Module:
  public class App extends Application {
      @Override
      public void onCreate() {
          super.onCreate();
          try {
            //  Register GCUniPlugin module
              WXSDKEngine.registerModule("GCUniPlugin-Logger", FTLogModule.class);
              WXSDKEngine.registerModule("GCUniPlugin-RUM", FTRUMModule.class);
              WXSDKEngine.registerModule("GCUniPlugin-Tracer", FTTracerModule.class);
              WXSDKEngine.registerModule("GCUniPlugin-MobileAgent", FTSDKUniModule.class);
          } catch (Exception e) {
              e.printStackTrace();
          }
          ......
      }
  }

UniApp SDK and Native SDK Mixed Usage

  • When adding the GCUniPlugin dependency libraries as described above, the Native SDK has already been added to the host project, so you can directly call Native SDK methods.

  • SDK Initialization

    When using mixed mode, only initialize the Native SDK in the host App. There is no need to initialize it in the uni mini program, and you can directly call the methods provided by the UniApp SDK.

    Refer to iOS SDK Initialization Configuration and Android SDK Initialization Configuration for the SDK initialization method in the host App.

    Note: Ensure that the SDK initialization is completed in the host App before loading the uni mini program to ensure that the SDK is fully ready before calling any other SDK methods.

  • Additional Configuration for Android Integration:

    Configure the Gradle Plugin ft-plugin to collect App startup events, network request data, and Android Native-related events (page navigation, click events, Native network requests, WebView data).

SDK Initialization

Basic Configuration

// Configure in App.vue
<script>
    var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
    export default {
        onLaunch: function() {
            ftModule.sdkConfig({
                'datakitUrl': 'your datakitUrl',
                'debug': true,
                'env': 'common',
                'globalContext': {
                    'custom_key': 'custom value'
                }
            })
        }
    }
</script>
<style>
</style>
Parameter Name Parameter Type Required Description
datakitUrl string Yes URL address for local environment deployment (Datakit) reporting, example: http://10.0.0.1:9529, default port 9529. The device installing the SDK must be able to access this address. Note: Choose either datakitUrl or datawayUrl
datawayUrl string Yes Public Dataway reporting URL address, obtained from the [User Access Monitoring] application, example: https://open.dataway.url. The device installing the SDK must be able to access this address. Note: Choose either datakitUrl or datawayUrl
clientToken string Yes Authentication token, must be used with datawayUrl
debug boolean No Set whether to allow printing Debug logs, default false
env string No Environment, default prod, any character, recommended to use a single word, such as test etc.
service string No Set the name of the business or service, default: df_rum_ios, df_rum_android
globalContext object No Add custom tags
offlinePakcage boolean No Only supported on Android, whether to use offline packaging or uni mini program, default false, detailed description see Difference between Android Cloud Build and Offline Build
autoSync boolean No Whether to automatically sync data to the server after collection. Default YES. When NO, use the flushSyncData method to manage data synchronization manually
syncPageSize number No Set the number of entries for sync requests. Range [5,). Note: The larger the number of entries, the more computational resources the data synchronization will occupy, default is 10
syncSleepTime number No Set the sync interval time. Range [0,5000], default is not set
enableDataIntegerCompatible boolean No Recommended to enable when coexisting with web data. This configuration is used to handle web data type storage compatibility issues. Enabled by default in versions 0.2.1 and above
compressIntakeRequests boolean No Compress the uploaded sync data using deflate, default is off, supported in SDK 0.2.0 and above
enableLimitWithDbSize boolean No Enable db size limit for data, default 100MB, unit Byte, larger database means more disk pressure, default is off.
Note: After enabling, the Log configuration logCacheLimitCount and RUM configuration rumCacheLimitCount will become invalid. Supported in SDK 0.2.0 and above
dbCacheLimit number No DB cache size limit. Range [30MB,), default 100MB, unit byte, supported in SDK 0.2.0 and above
dbDiscardStrategy string No Set the data discard rule in the database.
Discard strategy: discard discard new data (default), discardOldest discard old data. Supported in SDK 0.2.0 and above
dataModifier object No Modify a single field. Supported in SDK 0.2.2 and above, see example here
lineDataModifier object No Modify a single piece of data. Supported in SDK 0.2.2 and above, see example here

RUM Configuration

var rum = uni.requireNativePlugin("GCUniPlugin-RUM");
rum.setConfig({
  'androidAppId':'YOUR_ANDROID_APP_ID',
  'iOSAppId':'YOUR_IOS_APP_ID',
  'errorMonitorType':'all', // or 'errorMonitorType':['battery','memory']
  'deviceMonitorType':['cpu','memory']// or  'deviceMonitorType':'all'
})
Parameter Name Parameter Type Required Description
androidAppId string Yes appId, applied in monitoring
iOSAppId string Yes appId, applied in monitoring
samplerate number No Sampling rate, range [0,1], 0 means no collection, 1 means full collection, default is 1. Scope is all View, Action, LongTask, Error data under the same session_id
sessionOnErrorSampleRate number No Set error collection rate, when the session is not sampled by samplerate, if an error occurs during the session, data from the 1 minute before the error can be collected, range [0,1], 0 means no collection, 1 means full collection, default is 0. Scope is all View, Action, LongTask, Error data under the same session_id. Supported in SDK 0.2.2 and above
enableNativeUserAction boolean No Whether to track Native Action, Button click events, pure uni-app applications are recommended to turn off, default is false, Android cloud build not supported
enableNativeUserResource boolean No Whether to automatically track Native Resource, default is false, Android cloud build not supported. Since uniapp network requests on iOS are implemented using system API, all resource data on iOS can be collected together after enabling, please disable manual collection on iOS to prevent duplicate data collection.
enableNativeUserView boolean No Whether to automatically track Native View, pure uni-app applications are recommended to turn off, default is false
errorMonitorType string/array No Error monitoring supplement types: all, battery, memory, cpu, default not set
deviceMonitorType string/array No Page monitoring supplement types: all, battery (only supported on Android), memory, cpu, fps, default not set
detectFrequency string No Page monitoring frequency: normal(default), frequent, rare
globalContext object No Custom global parameters, special key: track_id (used for tracking function)
enableResourceHostIP boolean No Whether to collect the IP address of the request target domain. Scope: only affects the default collection when enableNativeUserResource is true. iOS: Supported on >= iOS 13. Android: Single Okhttp has an IP caching mechanism for the same domain, the same OkhttpClient, under the condition that the server IP does not change, only one will be generated.
enableTrackNativeCrash boolean No Whether to enable monitoring of Android Java Crash and OC/C/C++ crashes, default is `false
enableTrackNativeAppANR boolean No Whether to enable monitoring of Native ANR, default is false
enableTrackNativeFreeze boolean No Whether to collect Native Freeze
nativeFreezeDurationMs number No Set the threshold for collecting Native Freeze stutters, range [100,), unit milliseconds. iOS default 250ms, Android default 1000ms
rumDiscardStrategy string No Discard strategy: discard discard new data (default), discardOldest discard old data
rumCacheLimitCount number No Local cache maximum RUM entry count limit [10_000,), default 100_000

Log Configuration

var logger = uni.requireNativePlugin("GCUniPlugin-Logger");
logger.setConfig({
  'enableLinkRumData':true,
  'enableCustomLog':true,
  'discardStrategy':'discardOldest'
})
Parameter Name Parameter Type Required Description
samplerate number No Sampling rate, range [0,1], 0 means no collection, 1 means full collection, default is 1.
enableLinkRumData boolean No Whether to link with RUM
enableCustomLog boolean No Whether to enable custom logs
discardStrategy string No Log discard strategy: discard discard new data (default), discardOldest discard old data
logLevelFilters array No Log level filtering, the array needs to be filled with log levels: info, warning, error, critical, ok
globalContext object No Custom global parameters
logCacheLimitCount number No Local cache maximum log entry count limit [1000,), larger logs mean more disk cache pressure, default 5000

Trace Configuration

var tracer = uni.requireNativePlugin("GCUniPlugin-Tracer");
tracer.setConfig({
  'traceType': 'ddTrace'
})
Parameter Name Parameter Type Required Description
samplerate number No Sampling rate, range [0,1], 0 means no collection, 1 means full collection, default is 1.
traceType string No Trace type: ddTrace (default), zipkinMultiHeader, zipkinSingleHeader, traceparent, skywalking, jaeger
enableLinkRUMData boolean No Whether to link with RUM data, default false
enableNativeAutoTrace boolean No Whether to enable native network auto-tracing for iOS NSURLSession, Android OKhttp, default false, Android cloud build not supported. Since uniapp network requests on iOS are implemented using system API, after enabling, network requests initiated by uniapp on iOS can be automatically traced, please disable manual trace on iOS to prevent trace and RUM data linking errors.

RUM User Data Tracking

var rum = uni.requireNativePlugin("GCUniPlugin-RUM");

Action

API - startAction

Start RUM Action.

RUM will bind the Resource, Error, LongTask events that may be triggered by this Action. Avoid adding multiple times within 0.1 s, the same View will only be associated with one Action at the same time, new Actions will be discarded if the previous Action has not ended. Does not affect Actions added with the addAction method.

rum.startAction({
  'actionName': 'action name',
  'actionType': 'action type'
})
Parameter Name Parameter Type Required Description
actionName string Yes Event name
actionType string Yes Event type
property object No Event context (optional)

API - addAction

Add Action event. This type of data cannot link Error, Resource, LongTask data, no discard logic.

rum.addAction({
  'actionName': 'action name',
  'actionType': 'action type'
})
Parameter Name Parameter Type Required Description
actionName string Yes Event name
actionType string Yes Event type
property object No Event context (optional)

View

  • Automatic Collection

Method 1: Only need to set App.vue and the first page the application enters. Refer to the example project Hbuilder_Example/App.vue, Hbuilder_Example/pages/index/index.vue in the SDK package GCUniPlugin plugin.

// step 1. Find GCWatchRouter.js and GCPageMixin.js in the SDK package and add them to your project
// step 2. Add Router monitoring in App.vue as follows:
<script>
  import WatchRouter from '@/GCWatchRouter.js'
  export default {
    mixins:[WatchRouter], //<--- Notice
  }
</script>
// step 3. Add pageMixin in the first page the application displays as follows
<script>
  import GCPageMixin from '../../GCPageMixin.js';
  export default {
    data() {
      return {}
    },
    mixins:[GCPageMixin], //<--- Notice
  }
</script>

Method 2: Apply to each page that needs monitoring, needs to be used separately from GCWatchRouter.js. Refer to the example project Hbuilder_Example/pages/rum/index.vue in the SDK package GCUniPlugin plugin.

//Find GCPageViewMixinOnly.js in the SDK package and add it to your project
<script>
import { rumViewMixin } from '../../GCPageViewMixinOnly.js';
export default {
    data() {
        return {            
        }
    },
    mixins:[rumViewMixin], //<--- Notice
    methods: {}
}
</script>
  • Manual Collection
// Manually collect View lifecycle
// step 1 (optional)
rum.onCreateView({
  'viewName': 'Current Page Name',
  'loadTime': 100000000,
})
// step 2
rum.startView('Current Page Name')
// step 3  
rum.stopView()         

API - onCreateView

Create page load time record

Field Type Required Description
viewName string Yes Page name
loadTime number Yes Page load time (nanosecond level timestamp)

API - startView

Enter page

Field Type Required Description
viewName string Yes Page name
property object No Event context (optional)

API - stopView

Leave page

Field Type Required Description
property object No Event context (optional)

Error

  • Automatic Collection
/// Use uniapp error monitoring function, triggered when a script error or API call error occurs
<script>
  var rum = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
  var appState = 'startup';
  // Can only be monitored in App.vue
  export default {
    onShow: function() {
      appState = 'run'
    },
    onError:function(err){   
      if (err instanceof Error){
        rum.addError({
          'message': err.message,
          'stack': err.stack,
          'state': appState,
        })
      }else if(err instanceof String){
        rum.addError({
          'message': err,
          'stack': err,
          'state': appState,
        })
      }
  }
</script>
  • Manual Collection
// Manually add
rum.addError({
  'message': 'Error message',
  'stack': 'Error stack',
})

API - addError

Add Error event

Field Type Required Description
message string Yes Error message
stack string Yes Stack trace
state string No App running state (unknown, startup, run)
type string No Error type, default uniapp_crash
property object No Event context (optional)

Resource

  • Automatic Collection

The SDK provides the method gc.request, which inherits the network request method of uni.request, and can replace uni.request for use.

Replacement Method

+ import gc from './GCRequest.js'; 
- uni.request({
+ gc.request({
  //...
});

Usage Example

//Find GCRequest.js in the SDK package and add it to your project
import gc from './GCRequest.js';
gc.request({
  url: requestUrl,
  method: method,
  header: header,
  filterPlatform:["ios"], 
  timeout:30000,
  success(res)  {
    console.log('success:' + JSON.stringify(res))
  },
  fail(err) {
    console.log('fail:' + JSON.stringify(err))
  },
  complete() {
    console.log('complete:' + JSON.stringify(err))
  }
});

Additional Field Type Required Description
filterPlatform array No When the enableNativeUserResource function is enabled, uniapp on iOS will automatically collect network request data initiated through system API. To prevent duplicate data collection, you can add filterPlatform: ["ios"] parameter when using gc.request to disable manual data collection on the iOS platform.
  • Manual Collection

Manually call startResource, stopResource, addResource to implement, refer to GCRequest.js for implementation.

API - startResource

HTTP request start

Field Type Required Description
key string Yes Request unique identifier
property object No Event context (optional)

API - stopResource

HTTP request end

Field Type Required Description
key string Yes Request unique identifier
property object No Event context (optional)

API - addResource

Parameter Name Parameter Type Required Description
key string Yes Request unique identifier
content content object Yes Request related data

content object

Prototype Parameter Type Description
url string Request url
httpMethod string HTTP method
requestHeader object Request header
responseHeader object Response header
responseBody string Response result
resourceStatus string Request result status code

Logger Log Printing

var logger = uni.requireNativePlugin("GCUniPlugin-Logger");
logger.logging({
  'content':`Log content`,
  'status':status
})

API - logging

Field Type Required Description
content string Yes Log content, can be JSON string
status string Yes Log level
property object No Event context (optional)

Log Levels

String Meaning
info Info
warning Warning
error Error
critical Critical
ok OK

Tracer Network Trace Tracking

  • Automatic Collection

Use gc.request for request calls, will automatically add Propagation Header, refer to Resource

  • Manual Collection
//Example using uni.request for network requests
var tracer = uni.requireNativePlugin("GCUniPlugin-Tracer");
let key = Utils.getUUID();//Refer to Hbuilder_Example/utils.js
var header = tracer.getTraceHeader({
      'key': key,
      'url': requestUrl,
})
uni.request({
        url: requestUrl,
        header: header,
        success() {

        },
        complete() {

        }
});

API - getTraceHeader

Get the request header needed for trace, and add it to the HTTP request header.

Field Type Required Description
key string Yes Request unique identifier
url string Yes Request URL

Return Type: object

User Information Binding and Unbinding

var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
ftModule.bindRUMUserData({
  'userId':'Test userId',
  'userName':'Test name',
  'userEmail':'[email protected]',
  'extra':{
    'age':'20'
  }
})

ftModule.unbindRUMUserData()

API - bindRUMUserData

Bind user information:

Field Type Required Description
userId string Yes User ID
userName string No User name
userEmail string No User email
extra object No User's additional information

API - unbindRUMUserData

Unbind current user.

Shut Down SDK

var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
ftModule.shutDown()

API - shutDown

Shut down SDK.

Clear SDK Cache Data

var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
ftModule.clearAllData()

API - clearAllData

Clear all data not yet uploaded to the server.

Active Data Sync

var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
ftModule.flushSyncData()

API - flushSyncData

When sdkConfig.autoSync is configured as true, no additional operation is needed, SDK will automatically sync.

When sdkConfig.autoSync is configured as false, you need to actively trigger the data sync method to sync data.

WebView Data Monitoring

WebView data monitoring requires integrating Web Monitoring SDK in the WebView access page.

Android only supports offline packaging and uni mini program

Data Masking

If you want to fully mask a field, it is recommended to use dataModifier, which performs better. If you need detailed rule replacement, it is recommended to use lineDataModifier.

Single Field Modification (dataModifier)

  • Function: Modify a single field value in the data

  • Parameter format: {key: newValue}

  • Example: {'device_uuid': 'xxx'} will replace the device_uuid field value in the target data with "xxx"

Single Data Modification (lineDataModifier)

  • Function: Modify specified field values in a certain type of data

  • Parameter format: {measurement: {key: newValue}}

  • Example: {'view': {'view_url': 'xxx'}} will modify the view_url field value in all view type data to "xxx"
  • measurement data type list:
  • RUM data: view, resource, action, long_task, error
  • Log data: log
 var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent"); 
  ftModule.sdkConfig({
                 datakitUrl: 'your datakitUrl',
                 debug: true,
         dataModifier: { 'device_uuid':'xxx'},
         lineDataModifier:{ 'resource' :{'response_header':'xxx'},
                            'view' :{'view_url':'xxx'},
    } 
    })

Add Custom Tags

var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
ftMobileSDK.appendGlobalContext({
          'ft_global_key':'ft_global_value'
})
ftMobileSDK.appendRUMGlobalContext({
          'ft_global_rum_key':'ft_global_rum_value'
})
ftMobileSDK.appendLogGlobalContext({
          'ft_global_log_key':'ft_global_log_value'
})                

API - appendGlobalContext

Add custom global parameters. Applies to RUM, Log data

Field Type Required Description
None object Yes Custom global parameters

API - appendRUMGlobalContext

Add custom RUM global parameters. Applies to RUM data

Field Type Required Description
None object Yes Custom global RUM parameters

API - appendLogGlobalContext

Add custom RUM, Log global parameters. Applies to Log data

Field Type Required Description
None object Yes Custom global Log parameters

FAQ

Plugin Development iOS Main Project UniPlugin-iOS Usage

Download UniApp Offline Development SDK

According to the version number of the uni-app development tool HBuilderX, download the SDK package required for developing plugins.

SDK package structure explanation

|--iOSSDK   
    |-- HBuilder-Hello              // uni-app offline packaging project
    |-- HBuilder-uniPluginDemo      // uni-app plugin development main project (the project needed in this document)
    |-- SDK                         // Dependency libraries and resource files

Drag the dependency libraries and resource files SDK folder into the UniPlugin-iOS folder, the directory structure after dragging should be as follows.

|-- UniPlugin-iOS
    |-- HBuilder-uniPluginDemo      // uni-app plugin development main project (the project needed in this document)
    |-- SDK                         // Dependency libraries and resource files

For more details, refer to iOS Plugin Development Environment Configuration.

Project Configuration

1.Architectures Settings

Because the simulator provided by Xcode 12 supports the arm64 architecture, the framework provided by uni_app supports the arm64 real machine, and the x86_64 simulator. So

Set Excluded Architectures Any iOS Simulator SDK : arm64.

2.Other Linker Flags

$(inherited) -ObjC -framework "FTMobileSDK" -framework "GC_UniPlugin_App"

3.Framework Search Paths

$(inherited)
"${PODS_CONFIGURATION_BUILD_DIR}/FTMobileSDK"
"${PODS_CONFIGURATION_BUILD_DIR}/GC-UniPlugin-App"
$(DEVELOPER_FRAMEWORKS_DIR)
$(PROJECT_DIR)/../SDK/libs
$(PROJECT_DIR)

Plugin Development Android Main Project UniPlugin-Android Usage

Project Configuration

For detailed dependency configuration, refer to Demo. For more Gradle extension parameter configuration, refer to Android SDK

|-- UniPlugin-Android
    |-- app
        |--build.gradle
        // ---> Configure ft-plugin
        // apply:'ft-plugin'

    |-- uniplugin_module
        |-- src
            |-- main
                |-- java
                    |-- com.ft.sdk.uniapp
        |-- build.gradle 
        //---> Configure dependencies dependencies
        //implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-sdk:xxxx'
        //implementation 'com.google.code.gson:gson:xxxx'
        //implementation 'com.cloudcare.ft.mobile.sdk.tracker.agent:ft-native:xxxx'

    |-- build.gradle
        //---> Configure repo
        //  maven {
        //          url 'https://mvnrepo.jiagouyun.com/repository/maven-releases'
        //  }
        //
        //--> Configure buildScrpit
        //  classpath 'com.cloudcare.ft.mobile.sdk.tracker.plugin:ft-plugin:xxxx'

Difference between Android Cloud Build and Offline Build

Android cloud build and offline build use two different integration logics. Offline build integration method is the same as TrueWatch Android SDK integration method, using Android Studio Gradle Plugin, cloud build cannot use Android Studio Gradle Plugin, so it can only implement some functions through the internal code of TrueWatch UniApp Native Plugin. Therefore, the offline build version has more configurable options than the cloud build version, the offlinePakcageparameter in the SDK configuration is to distinguish these two situations.

Others