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.

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.

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.

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.

Configuring baseUrl for On-Premise Applications

  • For On-Premise Applications: Include the following code to configure the base URL and API key:

  • For Non-On-Premise Applications: Only the API key needs to be configured:

Optional: Initialization Callback

To implement the initialization callback:

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

Optional: Enable Logging

Use logging only for debugging. Set .logging(true) during development and .logging(false) before release.

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?