Menu

Debug Mode

1. Enable the debugging mode in SDK.

// Enable Debug Mode; optional; default false; please don't release app online with debug mode enabled.
  let config:se_initial_config = {
    ...
    enableDebug: true,
    ...
  };

2. Add debugging devices in SolarEngine dashboard. 【Product - Data Management - Debug Mode】Then you can query detailed event logs of the reported data in real time.

3. Data reported in Debug Mode will not be stored in the database.

4. Debug Mode is disabled by default.

5. Please make sure to disable Debug mode before the official publish. To avoid that happening, as long as the device is not in the debugging device list, the data will be reported into the database normally.


Sample Code

function buildInitialConfig():se_initial_config{
  let config:se_initial_config = {
    ...
    enableDebug: true,
    ...
  };
  return config;
}

async function Initiate(){
  log("Initiate" );

  let appKey = "";
  if (Platform.OS === 'ios') {
     appKey = "07df077973a84ea7";
  } else if (Platform.OS === 'android') {
     appKey = "e62fe50b80fc6e5c";
  }    
  let config:se_initial_config = buildInitialConfig();

  let initiateOptions:SolarEngineInitiateOptions = {
    config:config,
    ...
  }
  SolarEngine.initialize(appKey,initiateOptions,(result:InitiateCompletionInfo) => {
    if (result.success) {
      Alert.alert('SDK Initiate Complete!')
    }
});


Previous
Integration Testing
Next
Policy Compliance
Last modified: 2024-12-05Powered by