Skip to content

fix!: remove deprecated API from auth & crashlytics #8636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions docs/migrating-to-v23.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,25 @@ previous: /migrate-to-v22
next: /typescript
---

⚠️ **REMOVED** ⚠️
# Firebase Crashlytics

Modular API method `isCrashlyticsCollectionEnabled(crashlytics)` has been removed, please use the property on Crashlytics instance
`getCrashlytics().isCrashlyticsCollectionEnabled` instead.

# Firebase Auth

`MultiFactorUser.enrolledFactor` has been removed, please use `MultiFactorUser.enrolledFactors`. See example:

# Firebase Dynamic Links has been Removed
```js
const credential = await signInWithEmailAndPassword(getAuth(), 'dummy@example.com', 'password');
const multiFactorUser = credential.user.multiFactor;
// Use below - remove any instances of `multiFactorUser.enrolledFactor`
console.log(multiFactorUser.enrolledFactors);
```

# Firebase Dynamic Links

⚠️ **REMOVED** ⚠️

This package has been deprecated and removed from the React Native Firebase repository.

Expand Down
2 changes: 0 additions & 2 deletions packages/auth/lib/multiFactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export class MultiFactorUser {
}
this._user = user;
this.enrolledFactors = user.multiFactor.enrolledFactors;
// @deprecated kept for backwards compatibility, please use enrolledFactors
this.enrolledFactor = user.multiFactor.enrolledFactors;
}

getSession() {
Expand Down
16 changes: 0 additions & 16 deletions packages/crashlytics/__tests__/crashlytics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
import {
firebase,
getCrashlytics,
isCrashlyticsCollectionEnabled,
checkForUnsentReports,
deleteUnsentReports,
didCrashOnPreviousExecution,
Expand Down Expand Up @@ -46,10 +45,6 @@ describe('Crashlytics', function () {
expect(getCrashlytics).toBeDefined();
});

it('`isCrashlyticsCollectionEnabled` function is properly exposed to end user', function () {
expect(isCrashlyticsCollectionEnabled).toBeDefined();
});

it('`checkForUnsentReports` function is properly exposed to end user', function () {
expect(checkForUnsentReports).toBeDefined();
});
Expand Down Expand Up @@ -210,16 +205,5 @@ describe('Crashlytics', function () {
'setCrashlyticsCollectionEnabled',
);
});

it('isCrashlyticsCollectionEnabled', function () {
const crashlytics = getCrashlytics();
checkV9Deprecation(
// swapped order here because we're deprecating the modular method and keeping the property on Crashlytics instance
() => crashlytics.isCrashlyticsCollectionEnabled,
() => isCrashlyticsCollectionEnabled(crashlytics),
'',
'`isCrashlyticsCollectionEnabled()` is deprecated, please use `Crashlytics.isCrashlyticsCollectionEnabled` property instead',
);
});
});
});
11 changes: 0 additions & 11 deletions packages/crashlytics/lib/modular/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ type FirebaseCrashlytics = FirebaseCrashlyticsTypes.Module;
*/
export declare function getCrashlytics(): FirebaseCrashlytics;

/**
* Whether Crashlytics reporting is enabled.
*
* #### Example
*
* ```js
* const crashlytics = getCrashlytics();
* const isEnabled = isCrashlyticsCollectionEnabled(crashlytics);
* ```
*/
export declare function isCrashlyticsCollectionEnabled(crashlytics: FirebaseCrashlytics): boolean;
/**
* Determines whether there are any unsent crash reports cached on the device. The callback only executes
* if automatic data collection is disabled.
Expand Down
21 changes: 0 additions & 21 deletions packages/crashlytics/lib/modular/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,6 @@ export function getCrashlytics() {
return getApp().crashlytics();
}

/**
* Whether Crashlytics reporting is enabled.
*
* #### Example
*
* ```js
* const crashlytics = getCrashlytics();
* const isEnabled = isCrashlyticsCollectionEnabled(crashlytics);
* ```
* @param {FirebaseCrashlytics} crashlytics
* @returns {boolean}
*/
export function isCrashlyticsCollectionEnabled(crashlytics) {
// Unique. Deprecating modular method and allow it as a property on Crashlytics instance.
// eslint-disable-next-line no-console
console.warn(
'`isCrashlyticsCollectionEnabled()` is deprecated, please use `Crashlytics.isCrashlyticsCollectionEnabled` property instead',
);
return crashlytics.isCrashlyticsCollectionEnabled;
}

/**
* Determines whether there are any unsent crash reports cached on the device. The callback only executes
* if automatic data collection is disabled.
Expand Down
Loading