Check out example codes for "unity connect to firebase". It will help you in understanding the concepts better.

Code Example 1

// Perform the steps at the following link to setup Firebase
// for your Unity project:

// To connect to the databse in a script, use the following
// two lines:
DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;

// To get a data snapshot and take action with it:
FirebaseDatabase.DefaultInstance.GetReference("DATABASENAME").GetValueAsync().ContinueWith(task => {
	if (task.IsFaulted)
		// Failure
	else if (task.IsCompleted)
		DataSnapshot snapshot = task.Result;
		// Success

Learn ReactJs, React Native from