Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

A test push from the Firebase console never shows up on the iPhone

ErrorFirebase console says the message was sent, but the iOS device shows nothing

Short answer

When a console message is accepted but the iPhone stays silent, the break is between Firebase and APNs or inside the app. Check four things in order: an APNs key uploaded to the Firebase project, the Push Notifications capability, the notification delegates and registration call in code, and the notification permission.

  • Applies to Xcode 26, firebase-ios-sdk 12, Swift 6, iOS 18
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print whether the user has allowed notifications. A refused permission explains silence without any Firebase fault.

    UNUserNotificationCenter.current().getNotificationSettings { settings in
        print("allowed:", settings.authorizationStatus == .authorized)
    }
  2. 2Match what you see, then jump to its fix

    1. 1The token exists and the console accepts the send, but nothing arrives on a real deviceNo APNs authentication key is uploaded to the Firebase projectFix
    2. 2didFailToRegisterForRemoteNotificationsWithError is called, or no APNs token is ever issuedThe app lacks the Push Notifications capabilityFix
    3. 3No token callback fires at allThe delegates are not set or registerForRemoteNotifications is never calledFix
    4. 4The first step prints allowed: falseThe user denied notifications, or turned them off laterFix

What does the error look like?

  • Firebase console says the message was sent, but the iOS device shows nothing
  • didReceiveRegistrationToken prints a token, yet no notification arrives

Cause 1 of 4

No APNs authentication key is uploaded to the Firebase project

1Check

In the Firebase console open Project settings, then Cloud Messaging, and look under iOS app configuration for an APNs authentication key. Firebase needs at least one key, development or production, with its key ID.

# Firebase console: Project settings > Cloud Messaging > iOS app configuration

2Fix

Create an APNs authentication key in your Apple Developer account, then upload it in that section with its key ID. Upload both a development and a production key if you test debug and release builds.

# Firebase console: APNs authentication key > Upload > choose the .p8 file > enter the key ID

3Verify

Send a test message to the device token again.

# Firebase console: Messaging > Send test message > paste the FCM token

Confirmed by firebase.google.com

Did this fix it?

Cause 2 of 4

The app lacks the Push Notifications capability

1Check

Apple says registration can fail when the app has no proper code-signing entitlement. Enabling the Push Notifications capability adds the aps-environment entitlement, and push must also be enabled for the App ID in the developer account.

grep -rn "aps-environment" --include=*.entitlements .

2Fix

In Xcode open the app target, Signing & Capabilities, and add Push Notifications. Make sure the App ID has push enabled, then rebuild.

# Xcode: target > Signing & Capabilities > + Capability > Push Notifications

3Verify

Run again and check that application(_:didRegisterForRemoteNotificationsWithDeviceToken:) is called.

# Console prints the APNs token line you added in that method

Confirmed by developer.apple.com

Did this fix it?

Cause 3 of 4

The delegates are not set or registerForRemoteNotifications is never called

1Check

Firebase's guide says you must assign both the UNUserNotificationCenter delegate and the Messaging delegate, ask for permission, and call registerForRemoteNotifications().

grep -rnE "UNUserNotificationCenter.current\(\).delegate|Messaging.messaging\(\).delegate" --include=*.swift .

2Fix

Set both delegates after FirebaseApp.configure(), request authorization, then register.

FirebaseApp.configure()
UNUserNotificationCenter.current().delegate = self
Messaging.messaging().delegate = self
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, _ in
    guard granted else { return }
    DispatchQueue.main.async { application.registerForRemoteNotifications() }
}

3Verify

Cold start the app on a device: the token callback should print.

# Xcode console: look for the FCM token line

Confirmed by firebase.google.com

Did this fix it?

Cause 4 of 4

The user denied notifications, or turned them off later

1Check

Apple notes that the system asks only once, later requests do not prompt, and people can change the app's settings at any time.

# iPhone: Settings > Notifications > your app

2Fix

Ask the user to turn notifications on in Settings. In the app, read the current settings and show a screen that explains why, instead of asking again.

let settings = await UNUserNotificationCenter.current().notificationSettings()
if settings.authorizationStatus == .denied {
    // show your own screen with a button that opens Settings
}

3Verify

After the user enables notifications, the first step prints allowed: true and a test push shows.

# Xcode console: allowed: true

Confirmed by developer.apple.com

Did this fix it?

How do I stop it coming back?

  • Keep a short checklist for every new Firebase iOS project: APNs key uploaded, capability added, delegates set.
  • Test on a physical iPhone with a build signed for the same environment as the key you uploaded.
  • Log the permission status at launch so a silent device is explained in one glance.
  • Use the same checklist for hybrid apps such as Capacitor, since the native iOS project still needs the key and capability.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

InstanceID token() no longer works in a Swift Firebase app

Instance ID calls fail to compile after upgrading Firebase to 8.0.0 or later

Firebase removed the Instance ID dependency from Messaging in 8.0.0, so InstanceID.instanceID() calls no longer belong in a current app.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.