DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;Dictionary<string, System.Object> update = new Dictionary<string, System.Object>();update["/Contacts/" + users[user].name.text] = new Dictionary<string, System.Object>(){{users[(user + 1) % 2].name.text, ServerValue.Timestamp}};update["/Messages/" + (users[0].name.text + "" + users[1].name.text) + "/Message" ] = new Dictionary<string, System.Object>(){{"From", users[user].name.text}};update["/Messages/" + (users[0].name.text + "" + users[1].name.text) + "/Message" ] = new Dictionary<string, System.Object>(){{"Message", users[user].message.text}};update["/Messages/" + (users[0].name.text + "" + users[1].name.text) + "/Message" ] = new Dictionary<string, System.Object>(){{"Time", ServerValue.Timestamp}};reference.UpdateChildrenAsync(update).ContinueWith(task =>{if (task.Exception != null)Debug.Log(task.Exception.ToString());else if (task.IsCompleted)Debug.Log("Message Sent");});;
Hello Bahadir,
You can create a push id without actually going and saving a record, and then use that as the key in your dictionary entries. It looks like there’s an example of this under update specific fields, where it calls https://firebase.google.com/docs/database/unity/save-data#update_specific_fields.
I hope that helps!
☼, Kato
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/8ad49b90-7c70-450d-91a4-dcb22f7721fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Oops, looks like something went wrong with the markup in that email. In case it's broken for you too, the example looks like this: string key = mDatabase.Child("scores").Push().Key;