notiflowsDocs
Channels & ProvidersMobile Push

Apple APNs

Configure Apple Push Notification service in Notiflows

Apple Push Notification service (APNs) delivers push notifications to iOS, iPadOS, macOS, watchOS, and tvOS devices.

Prerequisites

Before configuring APNs in Notiflows, you need:

  1. An Apple Developer account
  2. An App ID with Push Notifications capability enabled
  3. Either an APNs authentication key (.p8 file) or a push certificate — see Authentication methods below

Configuration

FieldRequiredDescription
Bundle IDYesYour app's bundle identifier (e.g., com.example.myapp)
EnvironmentYesProduction for App Store builds, Sandbox for development
Auth TypeYesKey (recommended) or Certificate

Authentication methods

APNs supports two authentication methods. You only need one.

Token-based authentication uses a signing key that Apple issues once per account. A single key works across all your apps and doesn't expire, making it the simpler option for most teams.

FieldRequiredDescription
Key IDYes10-character identifier shown when you download the key
Team IDYes10-character identifier found in your Apple Developer account membership
KeyYesContents of your .p8 key file

How to get your signing key:

  1. Go to Certificates, Identifiers & Profiles in your Apple Developer account
  2. Navigate to Keys and click the + button
  3. Name the key, check Apple Push Notifications service (APNs), and click Continue
  4. Click Register, then Download the .p8 file
  5. Note the Key ID displayed on the confirmation page

Apple only lets you download the .p8 file once. Store it securely. If you lose it, you'll need to revoke the key and create a new one.

Open the .p8 file in a text editor and paste the full contents (including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines) into the Key field in Notiflows.

For more details, see Apple's guide on establishing a token-based connection to APNs.

Certificate-based authentication

Certificate-based authentication uses a TLS client certificate specific to a single app. Certificates expire after one year and must be renewed.

FieldRequiredDescription
CertificateYesX.509 certificate in PEM format
Private KeyYesUnencrypted private key in PEM format

How to get your push certificate:

  1. Go to Certificates, Identifiers & Profiles in your Apple Developer account
  2. Navigate to Identifiers, select your App ID, and enable Push Notifications
  3. Click Configure and create a certificate for your environment (Development or Production)
  4. Follow the prompts to upload a Certificate Signing Request (CSR) and download the .cer file
  5. Open the .cer file in Keychain Access, then export it as a .p12 file

For more details, see Apple's guide on establishing a certificate-based connection to APNs.

Converting your .p12 to PEM format:

Notiflows expects PEM-formatted strings. Use the following commands to convert your .p12 file:

Extract the certificate:

openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12

Extract the private key (you'll be prompted to set a passphrase):

openssl pkcs12 -nocerts -out key.pem -in cert.p12

Remove the passphrase from the private key:

openssl rsa -in key.pem -out key_unencrypted.pem

Paste the contents of cert.pem into the Certificate field and key_unencrypted.pem into the Private Key field in Notiflows.

Push certificates are tied to a specific app and environment. You'll need separate certificates for development and production. Token-based authentication avoids this limitation — one key covers all apps and both environments.

Setup in Notiflows

  1. Navigate to Channels in your project
  2. Click Create Channel
  3. Select Mobile Push as the channel type
  4. Select Apple APNs as the provider
  5. Enter your Bundle ID
  6. Select the Environment (Production or Sandbox)
  7. Choose your Auth Type and enter the corresponding credentials
  8. Save the channel

Syncing device tokens

To deliver push notifications, Notiflows needs the APNs device token for each user. Your app receives this token from Apple at runtime and must sync it to Notiflows via the User API.

Set the device token as a channel setting on the user:

curl -X PUT https://api.notiflows.com/api/user/v1/channel-settings \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "YOUR_APNS_CHANNEL_ID",
    "settings": {
      "device_tokens": ["DEVICE_TOKEN_FROM_APPLE"]
    }
  }'

A user can have multiple device tokens (one per device). Notiflows sends the notification to the first token in the list.

Payload

When Notiflows delivers a push notification via APNs, the payload includes all configured fields. Only non-empty template fields are included.

{
  "aps": {
    "alert": {
      "title": "Rendered title",
      "body": "Rendered body",
      "subtitle": "Rendered subtitle"
    },
    "sound": "default",
    "badge": 3,
    "category": "MESSAGE_REPLY",
    "thread-id": "conv_456",
    "mutable-content": 1,
    "interruption-level": "time-sensitive",
    "relevance-score": 0.8
  },
  "notiflows_notification_id": "notif_abc123",
  "notiflows_delivery_id": "del_xyz789",
  "notiflows_image_url": "https://cdn.example.com/image.png",
  "notiflows_action_url": "https://app.com/orders/123",
  "notiflows_data": {}
}

The mutable-content flag is set automatically when an image URL is configured, enabling your Notification Service Extension to download and attach the image.

APNs headers are also set when applicable:

HeaderWhen set
apns-collapse-idWhen Collapse ID is configured
apns-priority5 when Priority is set to normal
apns-expirationComputed from TTL (current time + TTL seconds)

APNs-specific template fields

These fields are only shown when the channel provider is APNs:

FieldDescription
SubtitleSecondary text between title and body
Interruption LevelControls Focus mode behavior
Relevance ScoreRanking in Notification Summary (0.0–1.0)

See the Mobile Push overview for all shared template fields.

On this page