The SDK supports the following features:
- Register devices with Notifly to receive push notifications and display in-app popups. (In-app popups appear only while the app is in the foreground.)
- Send event and user data to Notifly for campaign targeting and analysis.
- Log user behavior as events and measure campaign performance.
Prerequisites
- Connect your Firebase project.
The Notifly Android SDK uses Firebase Cloud Messaging to send push notifications.
Connect Firebase
- Android 11 (API level 30) or later for in-app popups.
In-app popup campaigns are supported only on Android 11 or later.
1. Install the SDK
The Notifly Android SDK is distributed through JitPack.Configure Gradle
- Gradle 7.0 or later
- Earlier than Gradle 7.0
settings.gradle
Add the SDK dependency
build.gradle (Module: app)
The SDK receives frequent feature and security updates. Use the latest version on JitPack.
Initialize the SDK
Initialize the SDK in yourApplication class. If you initialize it in a specific Activity, initialization may not apply to other Activities.
If your app does not have an Application class,
create one and register it with the
create one and register it with the
android:name attribute in AndroidManifest.xml.AndroidManifest.xml
- Kotlin
- Java
Add the following code to
onCreate in your app’s Application class.MainApplication.kt
Find
NOTIFLY_PROJECT_ID and USERNAME on the settings page. PASSWORD is a placeholder for backward compatibility. Pass the same nonempty value as USERNAME. Do not pass a real password or API Secret Key. 2. Register user information
Notifly uses user identifiers (userId) and user properties (params) to personalize marketing campaigns.Registered user information supports segmentation and targeting for channels such as push notifications, email, and Kakao AlimTalk.
Complete SDK initialization with
Notifly.initialize() before calling the user methods. Set the user ID (Notifly.setUserId())
userId to the identifier of the signed-in user in your app.Notifly uses this value to track user events and personalize campaigns.
Clear the user ID
On sign-out, callsetUserId(null) to clear the association between the current device and the user.
To retain the same user data, manage it separately on your server or in your app.
- Kotlin
- Java
setUserId
Set user properties (Notifly.setUserProperties())
setUserProperties registers properties for the user.These properties support segment targeting, message personalization, and delivery channel selection.
Before you send sensitive user propertiesBefore you send a custom user property that needs protection, such as a name or address, register it with the exact key you plan to send and enable encryption under User Management > User List > Property management in the console.See Manage user properties for setup instructions and limitations.
Key-value pairs of user properties. Supports predefined keys such as
$email, $phone_number, and $line_user_id.$email: Email address for email campaigns.$phone_number: Phone number for SMS and Kakao campaigns.$line_user_id: LINE user ID for LINE message campaigns.- Custom fields: Define your own fields, such as
"plan","tier", and"country".
- Kotlin
- Java
setUserProperties
3. Log events (Notifly.trackEvent())
Record user behavior to use in campaign triggers, segment conditions, and performance analysis.For example, collect button clicks, page visits, and completed purchases as events.
segmentationEventParamKeys currently supports at most one key.- For example,
listOf("plan")makes the"plan"event parameter available for segmentation.
- Kotlin with Jetpack Compose
- Kotlin with XML
- Java
Notifly.trackEvent
4. Get the internal user ID
getNotiflyUserId() returns the unique user ID that Notifly manages internally.This ID is separate from the user ID set with
setUserId(). Most integrations do not need it.Use it when an external CRM or third-party integration requires Notifly’s internal user ID.
5. Test the integration
After you install the SDK, follow Test your integration to verify event collection and push notification delivery.6. Advanced integration
Push notification icons
Request push notification permission
Push notification click events
Push notification interceptor
In-app popup event listener
WebView
FAQ
Can I use Notifly with an existing Firebase Cloud Messaging integration?
Can I use Notifly with an existing Firebase Cloud Messaging integration?
The Notifly Android SDK can work alongside Firebase Cloud Messaging that your app already uses.
