Skip to content

feat(auth, ios): add fullName support for Sign in with Apple credentials - #9096

Open
russellwheatley wants to merge 11 commits into
mainfrom
apple-full-name
Open

feat(auth, ios): add fullName support for Sign in with Apple credentials#9096
russellwheatley wants to merge 11 commits into
mainfrom
apple-full-name

Conversation

@russellwheatley

@russellwheatley russellwheatley commented Jul 9, 2026

Copy link
Copy Markdown
Member

Description

Adds support for forwarding Apple's fullName (NSPersonNameComponents) to Firebase when signing in with the apple.com provider, so the user's display name can be set on first authorization instead of being lost.

  • Adds an AppleFullPersonName type and an optional fullName field on OAuthCredentialOptions.
  • AppleAuthProvider.credential() and OAuthProvider('apple.com').credential() now accept and forward fullName on the resulting OAuthCredential (including through toJSON/fromJSON).
  • iOS: signInWithCredential forwards fullName to FIROAuthProvider.appleCredentialWithIDToken:rawNonce:fullName:, so Firebase stores it as displayName on the newly created account.
  • Android: the Firebase Android SDK has no credential-level equivalent, so fullName is accepted (for TurboModule spec parity) and intentionally ignored; apps should call updateProfile() after sign-in on Android.
  • Web is unaffected (firebase-js-sdk's OAuthCredential has no fullName field on any platform); the parameter is accepted and ignored.
  • Regenerated the TurboModule codegen artifacts for the extended signInWithCredential signature.

Related issues

Linear: CP-158 (Auth: support Apple fullName in Sign in with Apple credential).
closes #8570

Manual Verification

Verified end-to-end on a physical iOS device using a local test harness (tests/local-tests/auth/apple-full-name.tsx + a native RNFBAppleSignInModule wrapping ASAuthorizationController - not part of this PR):

OAuthProvider('apple.com').credential({ idToken, rawNonce, fullName }) → signInWithCredential completes successfully; sign-in/out works repeatedly with no errors.
The screenshot below is a repeat sign-in (not this account's first-ever authorization for the bundle id), so Apple correctly withheld fullName this time - expected Apple behavior, not a regression. The native bridge change in RNFBAuthModule.mm that forwards a supplied fullName to FIROAuthProvider appleCredentialWithIDToken:rawNonce:fullName: is covered by the unit tests and provider.e2e.js.
apple-full-name manual e2e

Screenshot 2026-07-28 at 16 23 05

Happy to push up the apple-full-name.tsx manual harness (and its supporting native module) into this PR if reviewers want a repeatable way to re-verify - flagging it adds a small amount of test-only native (Objective-C) code to the testing app.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • yarn tests:jest packages/auth — 147/147 tests passing, including new coverage for fullName mapping, JSON round-tripping, and native bridge forwarding.
  • yarn lint:js, yarn tsc:compile, yarn compare:types — all clean.
  • yarn lint:ios:check (clang-format) and google-java-format — native changes conform.
  • node ./scripts/codegen-verify.mjs — regenerated codegen artifacts match exactly, no drift in any other package.

Think react-native-firebase is great? Please consider supporting the project with any of the below:

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces support for capturing and forwarding the user's full name during the initial Sign in with Apple flow on iOS. By extending the credential creation process and updating the native bridge, the library now allows developers to pass name components that Firebase uses to populate the user's display name. Note that this feature is iOS-specific, as the Firebase Android SDK does not currently support credential-level name injection; on Android, developers should continue to use updateProfile() post-sign-in.

Highlights

  • Apple Full Name Support: Added support for passing fullName (givenName, familyName, etc.) when using Sign in with Apple credentials on iOS, allowing Firebase to set the user's display name upon initial account creation.
  • Native Bridge Updates: Updated the native signInWithCredential method across Android and iOS to accept an optional fullName parameter, ensuring the data is correctly passed to the underlying Firebase SDKs.
  • TypeScript and Testing: Updated TypeScript definitions to include AppleFullPersonName and OAuthCredentialOptions.fullName, and added comprehensive unit tests to verify the credential mapping and bridge forwarding.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for forwarding the user's full name (fullName) during Sign in with Apple on iOS, allowing Firebase to store it as the account's display name on first sign-in. This is implemented by updating the TypeScript types, the native bridge on iOS to parse fullName into NSPersonNameComponents, and adding corresponding unit and type tests. Android and Web platforms gracefully ignore this field to maintain spec parity. The review feedback suggests two improvements in RNFBAuthModule.mm: optimizing the Apple provider check to avoid unnecessary dictionary parsing and allocation, and ensuring personNameComponentsFromDictionary: returns nil if no valid name components are present to prevent passing empty objects to the Firebase SDK.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/auth/ios/RNFBAuth/RNFBAuthModule.mm Outdated
Comment thread packages/auth/ios/RNFBAuth/RNFBAuthModule.mm Outdated
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.72727% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.57%. Comparing base (44a7a9a) to head (900c0e5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9096      +/-   ##
==========================================
+ Coverage   63.47%   63.57%   +0.10%     
==========================================
  Files         389      389              
  Lines       30763    30799      +36     
  Branches     4935     4944       +9     
==========================================
+ Hits        19524    19576      +52     
+ Misses      10533    10513      -20     
- Partials      706      710       +4     
Flag Coverage Δ
e2e-ts-ios 57.93% <61.20%> (-0.01%) ⬇️
e2e-ts-macos 49.72% <37.50%> (-<0.01%) ⬇️
ios-native 57.93% <61.20%> (-0.01%) ⬇️
jest 50.04% <96.16%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy

Copy link
Copy Markdown
Collaborator

I'm enjoying watching these creep up, even if ever so slowly, now that coverage is on everywhere and e2e is pretty reliably working+uploading the reports for tracking:

image

@github-actions

Copy link
Copy Markdown

Hello 👋, this PR has been opened for more than 14 days with no activity on it.

If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing!

You have 7 days until this gets closed automatically

@github-actions github-actions Bot added the Stale label Jul 27, 2026
@russellwheatley
russellwheatley marked this pull request as ready for review July 28, 2026 15:39
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - one comment on making the local test permanent (and if I understand correctly, it will work on an Apple simulator these days)

Reasonable fix though, can't think of another way to pass this through even though it's pretty single purpose ("OAuth, but only Apple provider, and only iOS...")

Leaving as approved un-merged, take the test feedback and do it, or ignore/defer that completely at your option, the fix itself looks good

Adds an "Auth Apple fullName Test" screen (tests/local-tests/auth) used to
manually verify OAuthProvider('apple.com').credential({ fullName }) end to
end on a real device/simulator, using @invertase/react-native-apple-authentication
to drive a genuine ASAuthorizationController flow. Also enables the Sign in
with Apple capability/entitlement on the testing app and corrects its
PRODUCT_BUNDLE_IDENTIFIER to the App ID actually registered on the Apple
Developer Portal (io.invertase.testing).
The io.invertase.testing correction is a separate infra concern (also needs
a GoogleService-Info.plist update) and will land in its own PR. Keep this PR
scoped to the fullName feature + its Sign in with Apple capability/entitlement.
Resolve conflicts by keeping main's RNFBAuthHelper SPM split and porting
Apple fullName credential handling into the helper. Take main's
Podfile.lock (CI regenerates via tests:ios:pod:install).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants