Skip to main content

Installation

This guide will walk you through the process of installing the Nudge SDK in your Android application.

Latest Version:

Pre Requisites

info
  • Minimum SDK Supported : 21+
  • Minimum Kotlin Version : 1.7+
  • Compile SDK Version : 34+
  • Android Gradle Plugin : 7.2.0+

Installing the package

To integrate the nudge_android_v2 SDK into your Android application, follow these steps:

1. Configure settings.gradle

Add the following repository to your settings.gradle file to download the Nudge SDK:

dependencyResolutionManagement {
repositories {
maven {
url "https://github.com/nudgenow/android/raw/prod_main/release/"
}
}
}

2. Add Plugin to build.gradle (Project-Level)

Ensure you have the Kotlin Android plugin in your project-level build.gradle:

plugins {
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

3. Add SDK Dependency to build.gradle (App-Level)

Import the nudge_android_v2 SDK module-wide in your app-level build.gradle:

 dependencies {
implementation "com.nudgenow.nudge_android:nudge_android_v2:latest_version"
}

4. Final Steps

Sync Gradle: After adding the dependencies, sync your project in Android Studio.


Initialization

Initialize NudgeCore in onCreate().

 import com.nudgenow.nudgecorev2.core.NudgeInitialise

class YourApplication : Application() {

override fun onCreate() {
super.onCreate()
NudgeCore.initialize(
application = this, // Context of Your Application
apiKey = "YOUR API KEY",
debugMode = true, // THIS WILL ENABLE Nudge's Log to get printed
region = Region.IN or Region.US
)
}
}
warning

Configure Proguard Rules

Add the below rule to your proguard rules

-keep class com.nudgenow.** { *; }