- 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.
In-app popups on Android require Android 11 (API level 30) or later.
Prerequisites
- Connect your Firebase project.
The Notifly iOS SDK uses Firebase Cloud Messaging to send push notifications.
Connect Firebase
- Register your APNs credentials for iOS.
Register APNs credentials
- For iOS builds, open
Runner.xcworkspacein Xcode.
1. Set up the plugin
Install the plugin
flutter pub add command adds the dependency to pubspec.yaml. The badge shows the latest published version. Configure iOS
1. Configure capabilities
-
Open
Runner.xcworkspacein Xcode. Use the workspace rather than.xcodeprojto build with the Notifly SDK. - Set the target’s minimum iOS version to 15.0 or later. Set the same minimum version in your Podfile.
-
Enable Push Notifications and Background Modes, including Remote notifications and Background fetch.


2. Configure AppDelegate.swift
- Locate the file.
- Import
notifly_sdk.
- Update
AppDelegate.swift.
FlutterAppDelegate methods to add the Notifly integration code.
- Swift
AppDelegate.swift
Configure an iOS Notification Service Extension (recommended)
Requires
notifly-sdk version 1.3.0 or later. Supported features
- Attach images and videos to push notifications.
- Track push notification delivery to analyze campaign performance in more detail.
Initialize the SDK
Add the Notifly plugin initialization code to your app’s entry point, such asmain.dart.
You can load environment variables with a package such as dotenv.
main.dart
Find
NOTIFLY_PROJECT_ID and NOTIFLY_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.
1. Set the user ID (NotiflyPlugin.setUserId())
Map userId to the identifier of the signed-in user in your app.Notifly uses this value to track user events and personalize campaigns.
Parameters
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.
- Dart
setUserId
2. Set user properties
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".
- Dart
setUserProperties
3. Log events
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.
Parameters
Use
segmentationEventParamKeys to make an event parameter (eventParams) available for targeting. You can specify at most one key.- Dart
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. Configure web push notifications (web only)
Complete this section only if you use web push notifications in Flutter Web.For iOS and Android apps, skip this section.
1. Register the service worker
Register a service worker to receive web push notifications.- Create
notifly-service-worker.jsin your Flutter project’sweb/directory. - Add the following code:
web/notifly-service-worker.js
This file receives and displays push notifications while the browser runs in the background.
2. Request web push permission
Web push notifications require the user’s explicit permission in the browser.- Automatic permission request (default)
- In the Notifly console, go to Settings > SDK Settings > Website Settings. Under Permission Prompt Settings, turn on Auto Display.
- When enabled, the permission prompt appears automatically when a user visits your website.
- Manual permission request (optional)

- Turn off the automatic display option in the console to control when your app requests permission.
- Call the following method:
requestPermission() works only when automatic permission requests are turned off in the console. 3. Permission behavior
- If the user has not chosen a permission setting, the prompt appears.

- If the user has already granted permission, the prompt does not appear again.
- If the user has denied permission, browser policy prevents the prompt from appearing again.
6. Test the integration
After you install the SDK, follow Test your integration to verify event collection and push notification delivery.7. Advanced integration
Push notification icons
Request push notification permission
Push notification click events
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.
