BLOGS

Flutter Push Notifications: iOS, Android, Web (Part 2: iOS)

September 10, 2025

Learn how to implement push notifications in your Flutter iOS app using NotificationAPI and Apple Push Notification service (APNs). Practical, step-by-step guide based on a real device walkthrough.

Flutter Push Notifications: iOS, Android, Web (Part 2: iOS)

YouTube Walkthrough

In this tutorial (Part 2 of our Flutter Push Notifications series), you’ll learn how to implement push notifications in your Flutter iOS application using NotificationAPI and Apple Push Notification service (APNs). This guide is iOS-specific and complements our Android tutorial.

Why Push Notifications Are Complex (And How We’ll Simplify Them)

The complex architecture of push notifications

Push notifications are notoriously difficult to implement. Here’s why:

This typically requires building a complete backend infrastructure just to send a “Hello World” notification. But we have a much simpler approach.

Why Use NotificationAPI for Flutter Push Notifications?

The complex architecture of push notifications

NotificationAPI reduces the complex 5–6 step process into just 3 simple steps:

  1. Create an APNs key (in your Apple Developer account)
  2. Connect NotificationAPI to APNs (paste your key details in our dashboard)
  3. Install our SDK and start sending notifications by user ID

All the complex permission handling, token generation/refresh, and secure storage happen automatically under the hood.

Prerequisites for iOS

Before you start, note the following platform requirements:

Step 1: NotificationAPI Account

  1. Sign up at NotificationAPI (generous free tier)
  2. Create a new notification: “Hello World”
  3. Select Mobile Push as the notification type
  4. Open the Mobile Integration tab → Apple Push Notification (APNs)

You’ll see a form asking for:

Keep this page open — we’ll fill it out after creating the APNs key.

Step 2: Create an APNs Key in Apple Developer

In your Apple Developer account:

  1. Go to Certificates, Identifiers & ProfilesKeys
  2. Click + to create a new key
  3. Name it (e.g., NotificationAPI)
  4. Enable Apple Push Notifications service (APNs)
  5. Prefer selecting both Sandbox and Production (one key works for both)
  6. Click ContinueRegisterDownload the key file (AuthKey_XXXXXX.p8)

Important:

Connect APNs to NotificationAPI

Return to the NotificationAPI dashboard’s APNs form and fill in:

Save the configuration. NotificationAPI can now send push notifications through your APNs credentials.

Step 3: Integrate the Flutter SDK

Add the NotificationAPI Flutter SDK to your project:

flutter pub add notificationapi_flutter_sdk

Initialize the SDK in your app after the user is identified/logged in:

import 'package:flutter/material.dart';
import 'package:notificationapi_flutter_sdk/notificationapi_flutter_sdk.dart';

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    NotificationAPI.setup(
      clientId: 'YOUR_CLIENT_ID',
      userId: 'user_a', // Replace with your app's unique user identifier
      // region: 'eu' | 'ca' // Only if your account is in EU/Canada
    );
  }

  // ... rest of your app
}

Notes:

Step 4: iOS Project Setup (Xcode)

Because iOS requires proper signing and capabilities, ensure the following in Xcode for the Runner target:

  1. Open the Flutter iOS project in Xcode (ios/Runner.xcworkspace)
  2. In RunnerSigning & Capabilities:
    • Select your Team (paid Apple Developer account)
    • Set the Bundle Identifier (e.g., com.example.flutter_ios_demo)
    • Ensure Automatically manage signing is enabled (for development)
  3. Click + Capability and add Push Notifications
  4. Make sure the Bundle Identifier exactly matches the Topic you configured in NotificationAPI

Deploy to a real iPhone (Developer Mode enabled) via Xcode or flutter run. On first launch, iOS will prompt for notification permission — tap Allow.

Verify Device Registration

After the app runs with NotificationAPI.setup(...):

Send Your First Push Notification

Use the code samples in the NotificationAPI dashboard, or try cURL:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Basic $(echo -n "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" | base64)" \
  -d '{
    "type": "hello_world_notification",
    "to": {
      "id": "user_a"
    },
    "mobile_push": {
      "title": "Hello from Flutter on iOS!",
      "message": "Your first iOS push notification is working!"
    }
  }' \
  "https://api.notificationapi.com/YOUR_CLIENT_ID/sender"

Troubleshooting common issues:

Security Best Practices

  1. Server-Side Only: Never put your NotificationAPI credentials or APNs keys in client-side code. Never commit them to version control.
  2. Token Management: Let NotificationAPI handle token refreshing and management automatically.

Tips for a Better UX

Next Steps: Android and Web Support

This tutorial focused on iOS. For Android, see Part 1. A web-specific tutorial is coming soon.

Further Reading

Feedback and Support

Questions or feedback? Reach out at support@notificationapi.com or the website chat widget.