Hey Guys,
First of all thanks for your work on this!
The firebase web documentation here: https://firebase.google.com/docs/database/web/read-and-write describes the ability to get a key from a newly pushed ref like this
// Get a key for a new Post.
var newPostKey = firebase.database().ref().child('posts').push().key;
This doesn’t seem to work using this, as push() seems to return a promise. Also from what I can tell, the source code has a return type of void
. Is there a way to do this?
const postKey = firebase.database().ref().child('posts').push().key;
works for me with"react-native-firebase": "^1.0.10",
use this:
var TheUniqueKeyOfPush = firebase.database().ref().push().getKey();
and then:
Use the variable because it contains the unique key.