- Register device information with Notifly to receive push notifications and display in-app popups. In-app popups appear only while the app is in the foreground.
- Send events and user information to Notifly for campaign targeting and analytics.
- Log user actions as events and measure campaign performance.
Before you begin
Complete the following steps before installing the SDK.- Connect your Firebase project.
The Notifly iOS SDK uses Firebase Cloud Messaging to send push notifications.
Firebase project integration guide
- Register your iOS APNs credentials.
Register an APNs authentication key
- For iOS builds, open the
.xcworkspacefile in Xcode.
1. Install the SDK
Install the package
Install notifly-sdk from npm. The badge below shows the latest version:- npm
- yarn
This adds
notifly-sdk to package.json. Configure iOS
1. Configure capabilities
-
Open
{Your_Project_Name}.xcworkspacein Xcode. Build your app from this workspace to include the Notifly SDK. - Set the target’s minimum iOS version to 15.0 or later. Use the same minimum version in your Podfile.
-
Enable Push Notifications and Background Modes, including Remote notifications and Background fetch.


2. Configure AppDelegate.mm
- Locate the file
AppDelegate.mm is located at the following path:
- Import
notifly_sdk
- Add the
UNUserNotificationCenterDelegateprotocol
AppDelegate.h, update the AppDelegate class to implement UNUserNotificationCenterDelegate.
- AppDelegate.h
Header
- Update the
AppDelegatemethods
AppDelegate.mm.
- AppDelegate.mm
AppDelegate.mm
Configure an iOS Notification Service Extension (recommended)
Requires
notifly-sdk 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.
Add initialization code
Add initialization code to your app’s entry point,index.js or App.js.
index.js
Find
projectId and username on the settings page. password is a placeholder for backward compatibility. Do not enter a real password or API Secret Key. Pass the same nonempty value as username. 2. Register user information
Notifly uses the user ID (userId) and user properties (params) to personalize marketing campaigns.Registered user information is used for segmentation and targeting across channels such as push notifications, email, and Kakao AlimTalk.
1. Set the user ID (Notifly.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.
- JavaScript
setUserId
2. Set user properties
setUserProperties registers user properties.These properties are used for segment targeting, message personalization, and delivery channel selection.
Before sending sensitive user propertiesBefore sending custom user properties that need protection, such as names or addresses, register each key under User Management > User List > Property management in the console and enable encryption. Use the same key names as in the data you send.For setup instructions and limitations, see the property management guide.
User property key-value pairs. Supports predefined keys such as
$email, $phone_number, and $line_user_id.$emailis the address for email campaigns.$phone_numberis the phone number for SMS and Kakao campaigns.$line_user_idis the LINE user ID for LINE message campaigns.- You can also define custom fields such as
"plan","tier", and"country".
- JavaScript
setUserProperties
3. Log events
Record user actions for campaign triggers, segment conditions, and performance analysis.For example, collect button clicks, page views, and completed purchases as events.
Parameters
Use
segmentationEventParamKeys to make event parameters (eventParams) available for targeting and related settings. You can specify at most one key.- JavaScript
trackEvent
4. Test the integration
After you install the SDK, follow Test your integration to verify event collection and push notification delivery.5. Advanced integration
Request push notification permission
Subscribe to push notification click events
In-app popup event listener
FAQ
Can I use the SDK with an existing Firebase Cloud Messaging integration?
Can I use the SDK with an existing Firebase Cloud Messaging integration?
The Notifly Android SDK can coexist with Firebase Cloud Messaging already used in your app.
The build reports a Notifly class error in AppDelegate.mm.
The build reports a Notifly class error in AppDelegate.mm.
Add
use_frameworks! :linkage => :static to your Podfile to try static linking. If use_frameworks! already exists, add only the :linkage => :static option.Push notifications do not appear on iOS while the app is in the foreground.
Push notifications do not appear on iOS while the app is in the foreground.
If you already use Firebase Messaging, configure
firebase.json as described below.Following the React Native Firebase foreground presentation options guide, add the following code to firebase.json.The compiler cannot find notifly_sdk-Swift.h.
The compiler cannot find notifly_sdk-Swift.h.
- The iOS
notifly_sdkis written in Swift. During the build, Xcode generates the Swift compatibility headernotifly_sdk-Swift.hto expose it to Objective-C. Add"${PODS_CONFIGURATION_BUILD_DIR}"to Header Search Paths in the build settings for your target. - Import Swift into Objective-C
