Example #1
0
    public void AddRow(double _lat, double _lon, string _data)
    {
        string   key = FirebaseDatabase.DefaultInstance.GetReference("Rows").Push().Key;
        RowEntry e   = new RowEntry(_lat, _lon, _data);
        Dictionary <string, System.Object> eVal         = e.ToDictionary();
        Dictionary <string, System.Object> childUpdates = new Dictionary <string, System.Object>();

        childUpdates["/Rows/" + key] = eVal;
        FirebaseDatabase.DefaultInstance.GetReference("Rows").UpdateChildrenAsync(childUpdates);
    }
    //To save the review to cloud database
    public void save()
    {
        Debug.Log("Saving to database");
        string content = i.text;

        i.text = "";
        char[]   splitChar = { '\n' };
        string[] list      = mTargetMetadata.Split(splitChar);
        string   tag       = list [0];
        string   key       = FirebaseDatabase.DefaultInstance.GetReference("Rows").Push().Key;
        RowEntry e         = new RowEntry(tag, content);
        Dictionary <string, System.Object> eVal         = e.ToDictionary();
        Dictionary <string, System.Object> childUpdates = new Dictionary <string, System.Object>();

        childUpdates["/Rows/" + key] = eVal;
        FirebaseDatabase.DefaultInstance.GetReference("Rows").UpdateChildrenAsync(childUpdates);
    }