For the complete documentation index, see llms.txt. This page is also available as Markdown.

SDK Integration

Onboarding Checklist: Android

Please find the Onboarding Checklist for iOS and Android below. Follow the titles in the checklist to ensure you have completed each essential step in your onboarding process with Netmera.

Step 1: Select a Platform

  1. Navigate to Developers > Netmera Onboarding.

  2. Select Android and click Start to proceed.

Step 2: Create a Firebase Configuration

Netmera uses Firebase Cloud Messaging (FCM) for delivering push notifications.

  1. Go to the Firebase Developers Console and create a new project.

  2. Generate a new Private Key (JSON file) for your project.

spinner
  1. Upload the JSON file you downloaded from Firebase Cloud Messaging to the Project > app-level root directory.

  1. Choose one of the four options: Node.js, Java, Python, and Go. The choice of option does not require any action. Simply click the 'Generate New Private Key' button to download the file. No further selections are needed.

  1. Upload this file in Netmera Panel > Developers > Netmera Onboarding > Android > Step 2: Create A Firebase Configuration > FCM Service Account Key.

Step 3: Select a Target SDK

Select the SDK for your application development framework as Native Android.

Step 4: Integrate Netmera SDK

Standard Gradle

If your project is using Standard Gradle:

  • Add the following snippets to integrate the Netmera SDK into your project.

In this step, only copy the url specified below and add it to maven.

You should add Netmera dependency to your dependencies section in your: build.gradle(:app)

Netmera BOM (Bill of Materials) Support

Using the BOM allows you to manage Netmera SDK versions more easily and ensures compatibility between nmcore, nmfcm, and nmhms modules.

Gradle Version Catalogs

If your project is using Gradle Version Catalogs:

  • Add the following snippets to integrate the Netmera SDK into your project.

Kotlin

If you want to integrate Huawei Mobile Services (HMS), add the following configuration to your build.gradle file before plugins. Following part is only for Huawei integration.

For more information, visit the following link: Huawei AppGallery Connect Guide.

Note: Check your libs.versions.toml file:

  • This file is usually located within the gradle folder in the root directory of your project.

  • Review how the relevant plugin is defined.

Netmera BOM (Bill of Materials) Support

Using the BOM allows you to manage Netmera SDK versions more easily and ensures compatibility between nmcore, nmfcm, and nmhms modules.

In this step, only copy the url "https://release.netmera.com/release/android" and add it to maven.

Netmera BOM (Bill of Materials) Support

Using the BOM allows you to manage Netmera SDK versions more easily and ensures compatibility between nmcore, nmfcm, and nmhms modules.

Groovy

If you want to integrate Huawei Mobile Services (HMS), add the following configuration to your build.gradle file before plugins. Following part is only for Huawei integration.

For more information, visit the following link: Huawei AppGallery Connect Guide.

Note: Check your libs.versions.toml file:

  • This file is usually located within the gradle folder in the root directory of your project.

  • Review how the relevant plugin is defined.

Netmera BOM (Bill of Materials) Support

Using the BOM allows you to manage Netmera SDK versions more easily and ensures compatibility between nmcore, nmfcm, and nmhms modules.

In this step, only copy the url "https://release.netmera.com/release/android" and add it to maven.

Netmera BOM (Bill of Materials) Support

Using the BOM allows you to manage Netmera SDK versions more easily and ensures compatibility between nmcore, nmfcm, and nmhms modules.

Step 5: Initialize Netmera SDK

Initialize Netmera SDK

  1. Add the following initialization code inside the onCreate() method of your Application class.

If Application Class is Not Already Present:

  1. Create an Application Class If your project doesn't yet have an Application class, create one and include the initialization code as shown below.

  2. Update AndroidManifest.xml In the AndroidManifest.xml, add your Application class by specifying android:name in the <application> tag.

  3. To exclude Netmera Android SDK files from auto-backup if your app supports backup, please see the relevant title Q10: Excluding Netmera Android SDK files from auto-backup if your app supports backup.

Configure netmera-config.json

  1. Create netmera-config.json in your app's assets/ directory.

  2. Add the sender IDs for the messaging services your app supports.

  3. Optionally configure the in-app message animations.

Netmera reads this file automatically during initialization.

popup_animation_type and banner_animation_type are optional. Netmera uses the default animation when either setting is omitted.

For supported values and examples, see Configure In-App Presentation Animations.

Configuring baseUrl for On-Premise Applications

  • For On-Premise Applications: Add baseUrl to NetmeraParams for using On-Premise

Optional: Initialization Callback

To implement the initialization callback:

  1. Add the following code to handle success and failure:

Optional: Enable Logging

Use NetmeraLogLevel to control how much the SDK writes to logcat. The available levels are DEBUG, INFO, ERROR and NONE. The default level is ERROR, so SDK error messages appear in logcat unless you set the level to NONE. Use DEBUG only for debugging during development.

Set the log level at initialization: pass the optional logLevel parameter to Netmera.init(params, logLevel) or Netmera.initWithHoldingOperation(params, logLevel).

Change the log level at runtime: call Netmera.setLogLevel(level).

If you initialize the SDK with NetmeraConfiguration, use NetmeraConfiguration.Builder.logLevel(level) instead.

Deprecated: Netmera.setLoggingEnabled(Boolean) and NetmeraConfiguration.logging are deprecated in favor of setLogLevel / logLevel. Existing code keeps working: true maps to DEBUG and false maps to NONE.

If your app uses a custom FirebaseMessagingService or HmsMessageService, review Custom FCM Implementation and Custom HMS Implementation before completing the integration.

Important Note for Obfuscation:

No special obfuscation rules are needed for Netmera. Its functionality remains unaffected, even with code obfuscation enabled.

Android SDK Integration Complete

The Android SDK integration has been successfully completed, and your devices are now set to receive the following types of push notifications via the Netmera Dashboard:

  • Standard Push Notifications

  • Interactive Push Notifications

  • Widgets

  • Push Notifications with Deeplinks

Warning During App Store Submission:

Last updated

Was this helpful?