skip to Main Content

I’ve been struggling to find a solution for obtaining the iOS Bundle ID and Android Package Name to register my React Native Expo app on Firebase using the Firebase JavaScript SDK. I’ve searched extensively, but haven’t been able to find a clear answer.

Do I need to switch to React Native Firebase instead of using the Firebase JavaScript SDK?

I would greatly appreciate any assistance or guidance on this matter. Thank you in advance.

This is my app.json:

{
  "expo": {
    "name": "testingfirebase",
    "slug": "testingfirebase",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "googleServicesFile": "./GoogleService-Info.plist",
      "supportsTablet": true
    },
    "android": {
      "googleServicesFile": "./google-services.json",
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      "@react-native-firebase/app",
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ]
  }
}

2

Answers


  1. To register your React Native Expo app on Firebase using the Firebase JavaScript SDK, you need to obtain the iOS Bundle ID and Android Package Name. Here’s how you can find them:

    iOS Bundle ID: Expo manages the creation of the iOS Bundle ID for you. You can find it in your Expo project’s app.json file. Look for the "ios" section and the "bundleIdentifier" key. The value associated with this key is your iOS Bundle ID.

    "ios": {
      "bundleIdentifier": "com.yourcompany.yourapp"
    }
    

    Android Package Name: Similarly, the Android Package Name can be found in the app.json file of your Expo project. Look for the "android" section and the "package" key. The value associated with this key is your Android Package Name.

    "android": {
      "package": "com.yourcompany.yourapp"
    }
    

    With these values, you can register your app on Firebase using the Firebase JavaScript SDK. You don’t necessarily need to switch to React Native Firebase unless you specifically require features provided by that library.

    Please note that the Firebase JavaScript SDK may have limitations when it comes to certain Firebase features or services that are more tailored to native development. If you find that you need additional functionality or face limitations with the JavaScript SDK, you can consider using React Native Firebase, which provides a more comprehensive set of Firebase functionalities specifically designed for React Native apps.

    Login or Signup to reply.
  2. There are 2 ways to interact with Firebase SDK with Expo.

    1. Firebase JavaScript SDK (Designed for the web)

    Firebase treats your app as a web app and you don’t need to configure either ios or Android package ID.

    Firebase JS SDK has limited features – Cloud Messaging/Notification, and Crashlytic are not supported.

    Docs – https://docs.expo.dev/guides/using-firebase/#using-firebase-js-sdk

    2. Use React Native Firebase

    This package uses the corresponding Native SDKs for both Android and ios. This requires a package ID for each platform.

    Docs – https://docs.expo.dev/guides/using-firebase/#install-and-initialize-react-native-firebase

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search