I want to send push notifications to a mobile app, so I installed Firebase Admin SDK to my .Net project.
I followed the instructions on Firebase docs, but when I call the SendAsync from the SDK, it just hangs. Any idea why it would hang? Am I missing steps?
Here is my API code (Note this is only demo code to get it to work):
public async void SendPushNotification()
{
FirebaseApp.Create(new AppOptions()
{
Credential = GoogleCredential.FromFile("path to json file"),
});
var registrationToken = "fqCo_-tXKvY:APA91bGQ47Q2egnqn4Ml...";
var message = new FirebaseAdmin.Messaging.Message()
{
Token = registrationToken,
};
string response = await FirebaseMessaging.DefaultInstance.SendAsync(message);
Console.WriteLine("Successfully sent message: " + response);
}