Skip to content

🐛 [@react-native-firebase/installations] Auto-register APNs on iOS when using FID for messaging #9112

Open

Description

@FabienBounoir

When targeting devices using Firebase Installation IDs (FIDs) obtained via @react-native-firebase/installations (as recommended in recent Firebase messaging documentation), sending push notifications to iOS devices fails from the backend with a NotRegistered (UNREGISTERED 404) error.

This happens because @react-native-firebase/installations operates independently from APNs. Unlike messaging().getToken()—which automatically handles or triggers APNs device registration under the hood—fetching an FID via installations().getId() does not register the device for remote notifications with Apple.

Because of this, Firebase's backend does not have an APNs token mapped to the FID on iOS, causing notifications to be rejected with NotRegistered.


When FirebaseMessagingInstallationIdEnabled is set to true (or when both @react-native-firebase/messaging and @react-native-firebase/installations are included in the project), the library should either:

  1. Automatically trigger APNs registration (registerDeviceForRemoteMessages()) under the hood when fetching/syncing the FID on iOS.
  2. Or provide an explicit helper method or configuration option within the SDK to automatically bind APNs registration to the FID, ensuring parity with how messaging().getToken() works.

Currently, the workaround on iOS is to manually force APNs registration before utilizing the FID:

import messaging from '@react-native-firebase/messaging';
import installations from '@react-native-firebase/installations';

if (Platform.OS === 'ios') {
  await messaging().registerDeviceForRemoteMessages();
}

const fid = await installations().getId();

Activity

  1. mikehardy commented on Jul 22, 2026

    @mikehardy
    Collaborator

    Thanks for bringing this to our attention! We'll look into this

  2. itsrehman14 commented on Jul 23, 2026

    @itsrehman14

    Hey! We're running into the same iOS NotRegistered and hoping you can point us at the right path before we give up on FID targeting for iOS — thanks in advance for looking into this!

    Setup: Expo SDK 54 / RN 0.81, @react-native-firebase/* 25.1.0 (defaults to firebase-ios-sdk 12.15.0), physical iPhone on iOS 26.5.1. Android FID targeting works for us via the manifest flag — this is iOS-only.

    What we've tried:

    1. The workaround in this thread — registerDeviceForRemoteMessages(), confirm getAPNSToken() is non-null, then target the FID from installations().getId(). Controlled A/B on one device at the same instant via firebase-admin: the full registration token delivers, but the bare FID → NotRegistered. So APNs is registered and the device is a live target — registering APNs first didn't make the FID resolvable.
    2. The full FID-registration path from the iOS docs — set FirebaseMessagingInstallationIdEnabled=YES, bump firebase-ios-sdk to 12.16.0 (which adds -[FIRMessaging registerWithCompletion:] + the messaging(_:didReceiveRegistration:) delegate), then call registerWithCompletion: and implement the delegate via a small custom native module (RNFB doesn't surface either). With the flag on, getToken() correctly starts failing ("use register() instead"), but after register() completes — no error, APNs token present — the FID is still NotRegistered.

    Questions:

    • Is there a currently-supported way to make iOS FID targeting deliverable through @react-native-firebase today, or does it need RNFB to bridge register() / didReceiveRegistration and wire it into its FIRApp/AppDelegate swizzling first?
    • In step 2, is there something we're missing that would let register() actually finalize the FID on iOS?
    • Is this bridging on the roadmap, or should we plan to stay on the full registration token for iOS for now?

    Happy to share a minimal repro if that helps. Thanks!

  3. mikehardy commented on Jul 23, 2026

    @mikehardy
    Collaborator

    Hi there 👋 - from the perspective of working or not / giving up on it or not - all of this stuff is supposed to work, and in my humble estimation the native messaging / notifications targeting capability is the primary reason to adopt react-native-firebase vs firebase-js-sdk, so we are motivated to get this right - that's a statement of intent.

    However, we haven't looked into this yet at all, apologies - we're just finishing up CocoaPods -> SPM migration which was an existential need for the library. We still need to do some analysis on our side and report back, and in the meantime we're very open to any additional information or even pull requests

  4. jskorlol commented on Oct 6, 2026

    @jskorlol

    Is there any news regarding FID support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions