Skip to content

Unable to get FCM token using "getToken()" method in iOS 26 #8937

Open

Description

@piyushlt987-del

FCM token is not being generated on iOS 26.0 using @react-native-firebase/messaging.

The issue occurs on:

❌ iOS 26.0 Simulator
❌ iOS 26.0 Physical Device

While the same implementation works fine on:

✅ iOS 18.6
✅ iOS 26.3

Error received:

[messaging/unknown] No APNS token specified before fetching FCM Token
Steps to Reproduce
await messaging().requestPermission();
await messaging().registerDeviceForRemoteMessages();
const token = await messaging().getToken();
Expected Behavior

FCM token should be returned.

Actual Behavior
Token is null OR
Error: No APNS token specified
Environment
React Native: 0.75.3
@react-native-firebase/messaging: 21.7.1
@react-native-firebase/app: 21.7.1
@notifee/react-native: 9.1.8
Notes
Push Notifications & Background Modes enabled
APNS token is not being received on iOS 26.0
Same setup works on other iOS versions
Question

Is this a known issue with iOS 26.0, or is there any workaround?

Activity

  1. MichaelVerdon commented on Mar 23, 2026

    @MichaelVerdon
    Contributor

    Hi there, can you confirm you did all of the setup steps you can mentioned here

  2. piyushlt987-del commented on Mar 23, 2026

    @piyushlt987-del
    Author

    Hi there, can you confirm you did all of the setup steps you can mentioned here

    I am facing an issue where the FCM token is not generated on iOS 26 using messaging().getToken() in my React Native project
    Project setup: React Native 0.75.3, React 18.3.1, @react-native-firebase/app and @react-native-firebase/messaging 21.7.1
    The same implementation works correctly on Android and other iOS versions like 18.6 and 26.3
    On iOS 26, messaging().getToken() always returns null
    The issue occurs on both simulator and real device
    Notification permission is requested using messaging().requestPermission() and is granted successfully
    No errors are shown in the console while fetching the token
    Foreground, background, and notification open handlers are properly set up and working
    All other notification functionalities seem to be working fine
    Need to know if there is any known issue, missing configuration, or additional setup required specifically for iOS 26 to retrieve the FCM token

    I am facing error :
    This method is deprecated (as well as all React Native Firebase namespaced API) and will be removed in the next major release as part of move to match Firebase Web modular SDK API. Please see migration guide for more details: https://rnfirebase.io/migrating-to-v22 Please use getApp() instead.

  3. MichaelVerdon commented on Mar 23, 2026

    @MichaelVerdon
    Contributor

    The reason you are getting this error (Not really an error, more of a warning) is because you are using the name-spaced API which is being deprecated and will eventually be completely removed so you will need to use the Modular API, here is an idea of how you might achieve this:

    const loadToken = async () => {
        setBusy(true);
        setError(null);
        try {
          if (Platform.OS === 'ios') {
            await registerDeviceForRemoteMessages(messaging);
          }
          const authStatus = await requestPermission(messaging);
          const ok =
            authStatus === AuthorizationStatus.AUTHORIZED ||
            authStatus === AuthorizationStatus.PROVISIONAL;
          if (!ok) {
            setError('Notification permission not granted');
            return;
          }
          const t = await getToken(messaging);
          setToken(t);
        } catch (e: unknown) {
          setError(e instanceof Error ? e.message : String(e));
        } finally {
          setBusy(false);
        }
      };
    

    For seeing usage with the modular API, i highly suggest checking out these docs: https://firebase.google.com/docs/reference/js?_gl=1*6l9brf*_up*MQ..*_ga*MTU5MDk4OTI1My4xNzc0MjYyNjY0*_ga_CW55HF8NVT*czE3NzQyNjI2NjQkbzEkZzAkdDE3NzQyNjI2NjQkajYwJGwwJGgw

  4. piyushlt987-del commented on Mar 23, 2026

    @piyushlt987-del
    Author

    The reason you are getting this error (Not really an error, more of a warning) is because you are using the name-spaced API which is being deprecated and will eventually be completely removed so you will need to use the Modular API, here is an idea of how you might achieve this:

    const loadToken = async () => {
        setBusy(true);
        setError(null);
        try {
          if (Platform.OS === 'ios') {
            await registerDeviceForRemoteMessages(messaging);
          }
          const authStatus = await requestPermission(messaging);
          const ok =
            authStatus === AuthorizationStatus.AUTHORIZED ||
            authStatus === AuthorizationStatus.PROVISIONAL;
          if (!ok) {
            setError('Notification permission not granted');
            return;
          }
          const t = await getToken(messaging);
          setToken(t);
        } catch (e: unknown) {
          setError(e instanceof Error ? e.message : String(e));
        } finally {
          setBusy(false);
        }
      };
    

    For seeing usage with the modular API, i highly suggest checking out these docs: https://firebase.google.com/docs/reference/js?_gl=1*6l9brf*_up*MQ..*_ga*MTU5MDk4OTI1My4xNzc0MjYyNjY0*_ga_CW55HF8NVT*czE3NzQyNjI2NjQkbzEkZzAkdDE3NzQyNjI2NjQkajYwJGwwJGgw

    Error : Permission Error: [Error: [messaging/unknown] The operation couldn’t be completed. No APNS token specified before fetching FCM Token]

  5. MichaelVerdon commented on Mar 23, 2026

    @MichaelVerdon
    Contributor

    In Info.plist, check:

    <key>FirebaseAppDelegateProxyEnabled</key>
    <true/>
    

    Got this from this thread: #7329 worth looking at.

  6. piyushlt987-del commented on Mar 24, 2026

    @piyushlt987-del
    Author

    In Info.plist, check:

    <key>FirebaseAppDelegateProxyEnabled</key>
    <true/>
    

    Got this from this thread: #7329 worth looking at.

    I have already added above key in the Info.plist.

    I also came across a similar discussion on the Apple Developer Forums:
    https://developer.apple.com/forums/thread/795433?answerId=856361022#856361022

    Thank you for your response.

  7. MichaelVerdon commented on Mar 24, 2026

    @MichaelVerdon
    Contributor

    Hi there, would you say the issue is therefore emulator related, are you using this emulator version?

  8. piyushlt987-del commented on Mar 24, 2026

    @piyushlt987-del
    Author

    Hi there, would you say the issue is therefore emulator related, are you using this emulator version?

    Yes, this issue is occurring on both the simulator and physical devices.

    iOS 26.0 Simulator
    iOS 26.0 Physical Device
    I

  9. VariabileAleatoria commented on Sep 21, 2026

    @VariabileAleatoria

    To me this occurs only on Simulator, apparently registerDeviceForRemoteMessages is not invoked on Silicon builds

    I had to guard all my getToken() invocations with DeviceInfo.isEmulatorSync()

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