firebaseNet
firebaseNet copied to clipboard
The execution stops on 'client.SendMessageAsync(message)'
Hi! I am trying to use this package on a Web Api project and the message is never sent.
In fact, when forcing the method to run synchronously, the .Result never gets a reference and the execution stops.
The referred block of code below:
var client = new FCMClient(AppConfig.GoogleFirebaseApiKey);
var message = new Message()
{
To = destination_user.FirebaseToken,
Notification = new AndroidNotification()
{
Body = mensagem,
Title = fromUser.Email,
Icon = "MyAppIcon"
}
};
var r = await client.SendMessageAsync(message);
Thanks in advance for any help.
Same issue here. When using fiddler I see that the message is correctly send to google. (fcm.googleapis.com) and that the response is a 200. But then the execution ends and execution stops.
https://blogs.msdn.microsoft.com/jpsanders/2017/08/28/asp-net-do-not-use-task-result-in-main-context/
I changed to lambda function and it started to work