TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
211 stars 49 forks source link

Firestore - SetDataAsync doesn't write data, no errors #343

Open rezamohamed opened 3 days ago

rezamohamed commented 3 days ago

The SetDataAsync doesn't seem to write any data. It creates the collection and the document, but the fields are empty. No Exceptions or errors are thrown, I get a data successfully written message:

        var data = new Dictionary<string, object>
        {
            { "StartingTab", 12345 } // Explicit integer value
        };

        try
        {
            await CrossFirebaseFirestore.Current
                .GetCollection("Users")
                .GetDocument("Testing")
                .SetDataAsync(data)
                .ContinueWith(task =>
                {
                    if (task.IsCompletedSuccessfully)
                    {
                        Console.WriteLine("Data successfully written!");
                    }
                    else
                    {
                        Console.WriteLine("Error writing data: " + task.Exception?.Message);
                    }
                });
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
            throw;
        }

CleanShot 2024-09-26 at 16 57 59@2x