NPNotify Partners Docs

SDK — Overview

Notify Partners provides client SDKs for three platforms — Web, Android, and iOS. All SDKs implement a unified server communication protocol.

Supported Platforms

PlatformTransportPackage / DependencyMinimum OS Version
WebWeb Push API (VAPID)Service Worker + @notify.partners/web-sdk (npm)Chrome 50+, Firefox 44+
AndroidFirebase Cloud Messaging (FCM)Maven Central partners.notify:notify-partners-sdkAndroid 5.0+ (API 21)
iOSApple Push Notification service (APNs)Swift Package Manager NotifyPartnersSDKiOS 13.0+

Common SDK Flow

All three SDKs implement the same server communication protocol:

  1. Generate a device token — a unique installation identifier is created or restored from local storage
  2. Register the device on the Notify Partners server
  3. Obtain transport token — FCM (Android), APNs (iOS), or Web Push subscription (Web)
  4. Send device info — platform, language, timezone, tags, and the transport token
  5. Periodic updates — device info is refreshed at a server-defined interval
  6. Push event trackingdelivered and clicked events are reported automatically
  7. Lifecycle trackingonscreen, background, closed events are sent to the server

Server API

  • Base URL: https://api.notify.partners/api/v3
  • Authentication: app_id in the URL path
  • Rate limit: 1000 QPS per app_id

Quick Start

Web

import { NotifyPartnersSDK } from '@notify.partners/web-sdk';

NotifyPartnersSDK.initialize({
  appId: 'YOUR_APP_ID',
  vapidKey: 'YOUR_VAPID_KEY',
});

See also: Web SDK

Android

// Application.onCreate()
NotifyPartnersSDK.initialize(
    context = this,
    appId = "YOUR_APP_ID"
)

See also: Android SDK

iOS

// AppDelegate.didFinishLaunchingWithOptions
let config = NotifyPartnersConfig(appId: "YOUR_APP_ID")
NotifyPartnersSDK.shared.initialize(config: config)

See also: iOS SDK

Server-Side Device Registration

If you want to register devices programmatically on the server (without a client SDK), use the SDK API directly via REST. This is useful for server-side applications, IoT devices, or cases where full control over the registration process is required.

Step 1 — create a device instance:

POST https://api.notify.partners/api/v3/apps/{app_id}/instances
Content-Type: application/json

{
  "ic_token": "550e8400-e29b-41d4-a716-446655440000",
  "ext_id": "user_123"
}

Response: { "id": "456", "just_created": true } — the instance id to use in subsequent requests.

Step 2 — update device information:

PUT https://api.notify.partners/api/v3/apps/{app_id}/instances/{ic_id}/info
Content-Type: application/json

{
  "platform_type": "android",
  "transport_type": "fcm",
  "transport_token": "FCM_TOKEN_HERE",
  "lang": "en",
  "country": "US",
  "tz_sec": 10800
}

The transport_type field must match the platform: fcm, apns, or webpush.

Step 3 — send a notification event (optional):

POST https://api.notify.partners/api/v3/apps/{app_id}/instances/{ic_id}/events/notification
Content-Type: application/json

{
  "msg_id": "MSG_ID_FROM_PUSH",
  "event": "delivered"
}

Supported events: delivered, clicked.

ic_token is the unique device identifier in your system (a UUID or any string up to 255 characters). It must remain constant for the same device.