Android SDK Setup
Follow this guide below:
Add the Gradle repository. Enter the following values inside the repositories block:
Where is the repositories block in your project?
For a project created through the latest Android Studio, it is located in settings.gradle -> dependencyResolutionManagement.
For others, build.gradle -> allprojects.
settings.gradle
build.gradle (legacy)
dependencyResolutionManagement {
repositories {
// Add the code below
maven { url 'https://jitpack.io' }
}
}
allprojects {
repositories {
// Add code below
maven { url 'https://jitpack.io' }
}
}
Open your App level build.gradle(<project>/<app>/build.gradle), add the SDK and click Sync Now to get up to date.
build.gradle
dependencies {
// Add the code below
implementation 'com.github.flarelane:FlareLane-Android-SDK:1.3.2'
}
Add initialization code to onCreate of Application Class (not Activity). Start by creating an Application Class first, and if you already have an Application Class, you can skip this process.
Enter
android.name=".MainApplication"
in the AndroidManifest.xml file and generate the MainApplication class file through the editor helper. You can also create this file manually.
Add the following code to
onCreate
. You can check your project ID at FlareLane console's Project.Java (MainApplication.java)
Kotlin (MainApplication.kt)
import com.flarelane.FlareLane;
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Add the code below
FlareLane.initWithContext(this, "INPUT_YOUR_PROJECT_ID");
}
}
import com.flarelane.FlareLane
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
// Add the code below
FlareLane.initWithContext(this, "INPUT_YOUR_PROJECT_ID")
}
}
After completing all the steps, build and run your app. Devices that subscribe to push notifications will be automatically added to FlareLane console's All Devices.
Before actual deployment, be sure to verify that the push notifications are being received properly on the device and that the statistics are accurately recorded when the push notifications are clicked.
To customize notification icons, see below:
Last modified 1mo ago