Android Question Firebase: How generate a unique key id to add into a FBRealtime Database?

Paolodc

Member
I haven't already found a method that generate a unique key in order to create a specific database child.
Firebase documentation reports that a push generates a new data path, with a server timestamp as its key. These keys look like -JiGh_31GA20JabpZBfa:

Java code:
// Generate a reference to a new location and add some data using push()
var newPostRef = postsRef.push({
author: "gracehop",
title: "Announcing COBOL, a New Programming Language"
});

// Get the unique ID generated by push() by accessing its key
var postID = newPostRef.key;


With B4A it doesn't work as in this example.
So, exist a something like a "generator key" for Firebase Realtime Database?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…