1
votes

I am trying add a database using react-native-firebase with an existing react-native app. My package.json dependencies include react-native-firebase and react-native-cli. However when I run expo start and use the run on iOS simulator tool it returns the error message: RNFirebase core modules was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects 'Podfile' and have run 'pod install'.

I have tried running thru a few tutorials but none of them have addressed my issue.

 "dependencies": {
        "@expo/samples": "~3.0.3",
        `enter code here`"@expo/vector-icons": "^10.0.3",
    "@react-navigation/web": "^1.0.0-alpha.9",
    "expo": "^34.0.1",
    "expo-asset": "^6.0.0",
    "expo-constants": "6.0.0",
    "expo-font": "^6.0.1",
    "expo-web-browser": "6.0.0",
    "fb-watchman": "^2.0.0",
    "moment": "^2.24.0",
    "mongodb-stitch-react-native-sdk": "^4.5.0",
    "react": "16.8.3",
    "react-dom": "^16.8.6",
    "react-native": "https://github.com/expo/react- 
    native/archive/sdk-34.0.0.tar.gz",
    "react-native-card-flip": "^1.0.4",
    "react-native-cardview": "^2.0.3",
    "react-native-cli": "^2.0.1",
    "react-native-confetti": "^0.1.0",
    "react-native-firebase": "^5.5.6",
    "react-native-gesture-handler": "~1.3.0",
};


    import { AppLoading } from 'expo';
    import firebase from 'react-native-firebase'
    import { Asset } from 'expo-asset';
    import * as Font from 'expo-font';
    import React, { useState, useEffect } from 'react';
    import { Platform, StatusBar, StyleSheet, View } from 'react- 
    native';
    import { Ionicons } from '@expo/vector-icons';
    import venues from './components/venueJSON';

    import AppNavigator from './navigation/AppNavigator';



    export default function App(props) {
      // react hooks
      const [isLoadingComplete, setLoadingComplete] = 
     useState(false);

     useEffect(() => {
        // Your web app's Firebase configuration
        var firebaseConfig = {
          apiKey: "AIzaSyAHhnWeyBtUHJTtigUNMwQv5naDfNwqoOQ",
          authDomain: "musability-91b3d.firebaseapp.com",
          databaseURL: "https://musability-91b3d.firebaseio.com",
          projectId: "musability-91b3d",
          storageBucket: "",
          messagingSenderId: "168169604472",
          appId: "1:168169604472:web:32bccbafe468799ff2b48d"
        };



    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);

    console.log(firebase);  
  })

I would like to have the right modules installed for iOS and android and be able to connect to the database and see it on both platforms.

1

1 Answers

0
votes

You should install react-native-firebase native for each platform.

For iOS - https://rnfirebase.io/docs/v5.x.x/installation/ios

For Android follow this - https://rnfirebase.io/docs/v5.x.x/installation/android