Android

Install SDK in React Native Environment

1. Common

MPM Module install

To apply IMQA SDK in the React native environment, execute the command below to install the package.

When Using npm Command
// npm install imqa-react-native-agent --save 
When Using yarn Command
yarn add imqa-react-native-agent

2. Installing Gradle plugin

In the “app.gradle” file, add “imqa-mpm-injector” to the “dependencies” block in the "buildscript" followed by “plugin” at the top. This is typically located in “<project_dir>/app/build.gradle”.

app.gradle(project root)
/// Add Build script dependencies 
buildscript { 
    repositories { 
        mavenCentral()
    } 
    
    dependencies {
    // Add dependencies.
        classpath 'io.imqa:imqa-mpm-injector:2.25.6' ... 
    } 
} 
  • java

  • kotlin

  • java + kotlin

3. Adding authority to the Android Manifest

You have to grant Internet authority to upload occurred crash information to AndroidManifest.xml.

4. Inserting the IMQA initialization code into the source code

Writing the IMQA start code

MPM Mode Option

You can change the IMQA MPM execution options using parameters or options. Check the execution options in Android MPM Configuration Options.

Shortcut mode

You can initialize IMQA MPM using the shortcut mode.

⚠️HTTPS (API level > 27)

The HTTPS request is required from Android API level 28 and above due to the enhanced network security policy. The following measures are needed to meet the requirement:

  1. Authenticated HTTPS request Request authenticated HTTPS to the IMQA server to collect the data normally.

  1. Forced HTTP request

    You can allow all cleartext HTTP traffic by setting this flag.

Using Zstandard (Zstd)

You can use Zstandard, which is an algorithm enabling more secure and efficient data compression, instead of the typical gzip. To use it, you need the following settings:

  1. Setting the MPM Mode Option You can set whether to use Zstd in the settings when inserting the IMQA startup code.

  1. Add Zstd Library In the “app.gradle” file, add the “zstd-jni” aar library to the “dependencies” block in “buildscript”.

5. ⚠️Issues in the current version

  1. ASM Conflict may occur with the library using ASM.

  2. APK Repackaging Source line information disappears while repackaging the APK. The auto-insert function should be executed during compilation, in order to include line information.

  3. Collecting library information The auto-insert function is not executed in the class file added to the library. The auto-insert function should be executed while repackaging the API, in order to collect information on what is executed in the library.

6. Settings required for the installation-type

Any client who selects an IMQA installation-type must set the collection server.

Last updated