Skip to content

FR: Firestore Web SDK React-Native/Expo support for Android devices #283

@samsafay

Description

@samsafay

Describe your environment

  • Operating System version: Android 4.4.2
  • Firebase SDK version: "^4.6.0"
  • Firebase Product: Firestore Web SDK
  • Expo: "^22.0.0"

Describe the problem

I am using Expo and trying to do basic CRUD with Firestore on an Android device and not getting any results. The same code works perfectly on an iOS device, but it doesn't work with Android. Can you take a look into that?

Steps to reproduce:

Basically create a react-native project, and Try any CRUD with Firestore. In my case fetching data from restaurants collection. Note, I am implementing Redux so you have to install 'react-redux' with your Expo project. As I said this code works perfectly with iOS but not with ANDROID. Let me know if you need more information.
Just tried this on react-native init project and got this error on my emulator. I just realized that this issue is related to #97.
1

Relevant Code:

import firebase from 'firebase';
import 'firebase/firestore';
import { Alert } from 'react-native';
import {
    RESTAURANTS_FETCH_SUCCESS,
} from './types';

export const restaurantsFetch = () => async dispatch => {
    try {
        const response = await firebase.firestore().collection('restaurants').get();
        response.forEach(doc => {
            dispatch({ type: RESTAURANTS_FETCH_SUCCESS, payload: { ...doc.data(), id: doc.id } });
        });
    } catch (err) {
        Alert.alert(err.message);
    }
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions