Doubt with Firebase

Asked

Viewed 92 times

1

After hearing about Firebase, and reading about it, I decided it was a good idea to test its use in my Unity app.

I read the documentation, followed the configuration tutorials, and even defined the authentication rules so that even non-authenticated users could include in the database. I made the following code only for test purposes

void Start()
{
    // Set up the Editor before calling into the realtime database.
    FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://magicast-bd2fc.firebaseio.com/");

    Firebase.Auth.FirebaseAuth.DefaultInstance.StateChanged += DefaultInstance_StateChanged;

    // Get the root reference location of the database.
    DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;

    var u = new User();
    u.email = "sdjkdsdksadjsad";
    u.fb_id = "sakdsajdhasd";
    u.username = "jadhsjahjsda";
    reference.SetValueAsync(u);
}

This code runs as soon as I run the Unity project, it even hits the breakpoints.

However, when looking at the Firebase Console of my application, in the Database tab, there is nothing! And no error is presented to me in this code. I cannot identify what I am doing wrong, and although this code is in C#, for Unity, I believe that the logic of Firebase is the same on all platforms, so all help is welcome.

Any tips? Maybe some configuration to do, or a small code to add

  • 1

    Good friend, check the rules of the database, it may be denied to those who are not authenticated, you can generate a random email to unknown users, you can generate a random email to the unknow user.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.