Skip to content

iOS push notifications require an app restart because the initial FCM token is not uploaded #39

Closed

Description

@ebariaux

Description

On a fresh iOS installation, the console registers with the backend before Firebase provides an FCM token. When the token arrives, it is stored locally but the backend registration is not updated. Push notifications therefore remain unavailable until the app is restarted.

Steps to reproduce

  1. Launch a fresh installation and allow notifications.
  2. Complete console registration.
  3. Observe the FCM token arriving in the Xcode logs.
  4. Check the backend console asset: the token is absent.
  5. Send a Firebase Console test notification directly to the logged token: delivery succeeds.
  6. Terminate and relaunch the app.
  7. The cached token is now uploaded to the backend, and backend notifications work.

Expected behaviour

The backend console registration is updated when the FCM token becomes available, without requiring an app restart.

Code responsible

On relaunch, the provider finds the cached token and includes it in registration, explaining the workaround.

Required fix

Propagate token availability and subsequent token changes to the web app, update providers.push.data.token, and resend the console registration. Verify first-launch delivery with delayed token generation, without restarting the app.

The first-launch race is in ORLib’s push provider, but a complete fix needs coordination with the app.

  • ORLib starts APNs registration and immediately reports successful provider enablement using the cached token—even when no token exists. It has no handling for a token arriving later.
  • The app owns Firebase’s didReceiveRegistrationToken callback. Currently, it only saves the token locally; it doesn’t notify ORLib.

The reusable fix would be:

  1. ORLib exposes a method to receive new or refreshed FCM tokens.
  2. The app calls that method from its Firebase callback.
  3. ORLib propagates the token to the web app, which updates the backend registration.

The app would need a small integration change to use that API. The backend registration endpoint already works, as your relaunch test demonstrates.

Activity

  1. ebariaux commented on Oct 9, 2026

    @ebariaux
    ContributorAuthor

    Implementing #21 first might be a good idea to avoid having fixes in all apps.

  2. self-assigned this
    on Oct 14, 2026
  3. MartinaeyNL commented on Oct 15, 2026

    @MartinaeyNL
    Member

    I think this has been resolved in #40, which has been merged.
    If someone believes it's not, feel free to reopen the issue 👍

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

Metadata

Metadata

Labels

BugError or issue in the system

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions