Jump to top

Platforms

Learn the platforms React Native Firebase SDK supports.

Status

By default React Native Firebase supports multiple platforms using the native Firebase SDK for the specific platform:

  • Android
  • iOS

However, for platforms that we don't provide a Native Module for, React Native Firebase instead implements a fallback Firebase JS SDK implementation to support these 'Other' platforms, e.g.;

  • Web
  • macOS
  • Windows
  • ...and any other RN based environment.

Below is a table outlining which Firebase modules are supported on each platform in React Native Firebase:

Firebase ServiceAndroidiOSOther
analytics๐ŸŸข๐ŸŸข๐ŸŸข
app-check๐ŸŸ ๐ŸŸ ๐ŸŸ 
app-distribution๐ŸŸข๐ŸŸข๐Ÿ”ด
app๐ŸŸข๐ŸŸข๐ŸŸข
auth๐ŸŸข๐ŸŸข๐ŸŸ 
crashlytics๐ŸŸข๐ŸŸข๐Ÿ”ด
database๐ŸŸข๐ŸŸข๐ŸŸข
dynamic-links๐ŸŸข๐ŸŸข๐Ÿ”ด
firestore๐ŸŸข๐ŸŸข๐ŸŸ 
functions๐ŸŸข๐ŸŸข๐ŸŸข
in-app-messaging๐ŸŸข๐ŸŸข๐Ÿ”ด
installations๐ŸŸข๐ŸŸข๐Ÿ”ด
messaging๐ŸŸข๐ŸŸข๐Ÿ”ด
ml๐ŸŸข๐ŸŸข๐Ÿ”ด
perf๐ŸŸข๐ŸŸข๐Ÿ”ด
remote-config๐ŸŸข๐ŸŸข๐ŸŸข
storage๐ŸŸข๐ŸŸข๐ŸŸ 
  • ๐ŸŸข (supported)
  • ๐ŸŸ  (partial support) - see notes below
  • ๐Ÿ”ด (not supported)

Other Platforms

Whenever the React Native Firebase SDK is running on platforms other than Android or iOS, the internal implementation uses a fallback platform which is implemented in JavaScript, using the Firebase JavaScript Modular SDK.

No implementation changes are required to use the React Native Firebase SDK on other platforms, as the JavaScript implementation is automatically used when a native platform is not available. This allows you to use the same API across all platforms, regardless of the underlying implementation.

There are however some minor limitations or differences in behavior compared to the native platforms. Where a particular method is not supported, an error will be thrown with a code of unsupported to indicate the method is not available on the current platform.

Details of these limitations are summarized below.

Analytics

The other platform implementation of Analytics does not capture automatic metrics like screen view, you must call logEvent and other logging based methods to send your events to Firebase.

App Check

App Check for other platforms only supports the CustomProvider provider. Here's how to setup your own custom provider:

import firebase, { CustomProvider, initializeAppCheck } from '@react-native-firebase/app-check';

const myCustomProvider = new CustomProvider({
  async getToken: () => {
    // TODO: Get the token from your server, e.g. if using a cloud function call the function.
    const tokenFromServer = 'some-token-from-server';
    const expirationFromServer = 1000 * 60 * 60; // 1 hour
    const appCheckToken = {
      token: tokenFromServer,
      expireTimeMillis: expirationFromServer * 1000
    };
    return appCheckToken;
  }
});

// Configure the provider (modular API)
initializeAppCheck(firebaseApp, {
  provider: myCustomProvider
});

// Or configure the provider (v8 API)
firebase.appCheck().initializeAppCheck({ provider: myCustomProvider });

Authentication

Multi-factor authentication is not supported on other platforms.

Phone authentication methods are unsupported, specifically:

  • signInWithProvider
  • signInWithPhoneNumber
  • verifyPhoneNumberForMultiFactor
  • confirmationResultConfirm
  • verifyPhoneNumber
  • reauthenticateWithProvider

Database

Offline persistence is not supported on other platforms.

Unsupported methods:

  • keepSynced - for offline persistence

Firestore

For performance reasons and to reduce the size of the JavaScript bundle, the Other platform implementation in React Native Firebase uses the JavaScript lite SDK, which does not support methods related to offline & persistence.

Specifically, the following methods are not supported:

  • loadBundle
  • clearPersistence - for offline persistence
  • disableNetwork - for offline persistence
  • enableNetwork - for offline persistence
  • namedQuery
  • onSnapshot (for both CollectionReference & DocumentReference)
  • GetOptions.source

Storage

No-op methods:

  • setMaxDownloadRetryTime (does not throw, but has no effect)

Unsupported methods:

  • writeToFile
  • putFile