1

I am using firesharp package for posting values to firebase realtime database from c# code.But SetTaskAsync method throws error , I have followed same syntax which is referred in youtube tutorial/other blogs.

Code:

var notification = new AdminNotification { Id = "1234", message = "New Notification", isRead = "false", type ="0" };

IFirebaseConfig config = new FirebaseConfig
            {
                BasePath = "https://*******.firebaseio.com",
                AuthSecret= "**FireBaseApiKey**",

            };
            IFirebaseClient client;
            client = new FireSharp.FirebaseClient(config);

            var response = await client.SetTaskAsync("Notifications/", notification);

Exception is:

An error occured while execute request. Path : Notifications/ , Method : PATCH. An error occurred while sending the request. The server name or address could not be resolved

Stacktrace:

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at FireSharp.FirebaseClient.d__b`1.MoveNext()

Please help!

Vyasdev Meledath
  • 8,926
  • 20
  • 48
  • 68

1 Answers1

1

Note for AuthSecret : copy Authentication secret from

Project settings ->Services account -->Database secrets 

copy the code beside your project name

Isaac Be
  • 81
  • 1
  • 10