Closed NaserKhoshfetrat closed 4 years ago
You should set ConfigureAwait(false)
if you have any UI code: https://medium.com/bynder-tech/c-why-you-should-use-configureawait-false-in-your-library-code-d7837dce3d7f
PS: It solely depends on how threads are managed in your particular application. But if your application seems stuck that means it's deadlocked, and you have to use ConfigureAwait(false)
to avoid it.
thank you for sharing this article
at line
string response = await FirebaseMessaging.DefaultInstance.SendAsync(message).ConfigureAwait(true);
my code stuck , there is no error or response`public async Task SendToTokenAsync(string registrationToken, Dictionary<string, string> data)
{
// [START send_to_token]
var message = new Message()
{
Data = data,
Token = registrationToken,
};
I have initialized firebase credential in global.asax with below code
` private void InitSdkWithDefaultConfig(string credentialPath) { var credential = GoogleCredential.FromFile(credentialPath); // [START initialize_sdk_with_default_config] FirebaseApp.Create(new AppOptions() { Credential = credential, });
ps i've called via rest service, and it was working but i can't solve how to call via SDK
if i set ConfigureAwait(false) it is working properly