You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
does the react-native-firebase work with geofire-js? I am moving whole project from firebase to react-native-firebase and so far I didn't have any issues.
The only issue is the geofire-js. I cannot make it to work. Even simple writing of new key-value pair to the DB does not work.
I'm using built native app (Expo). All other firebase functions works well.
I've seen an issue posted some time ago but unfortunately this workaround does not work for me.
importdatabasefrom'@react-native-firebase/database';import{GeoFire}from'geofire';exportconstaddLocationToFirebase=async(id: string,coords: [number,number])=>{constrtdb=database();constgeoFireRef=rtdb.ref(`Geodata`)asany;geoFireRef.key=null;//previously working fixconstgeoFireInstance=newGeoFire(geoFireRef);awaitgeoFireInstance.set(id,coords);};
Result:
WARN Possible Unhandled Promise Rejection (id: 6):
TypeError: Attempted to assign to readonly property.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
does the react-native-firebase work with geofire-js? I am moving whole project from firebase to react-native-firebase and so far I didn't have any issues.
The only issue is the geofire-js. I cannot make it to work. Even simple writing of new key-value pair to the DB does not work.
I'm using built native app (Expo). All other firebase functions works well.
I've seen an issue posted some time ago but unfortunately this workaround does not work for me.
Code:
Result:
Code (using the fix from the issue):
Result:
package.json:
"@react-native-firebase/app": "^16.5.0",
"@react-native-firebase/auth": "^16.5.0",
"@react-native-firebase/database": "^16.5.0",
"expo": "~47.0.8",
"geofire": "^6.0.0",
"geofire-common": "^6.0.0",
...
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions