firebaseNet icon indicating copy to clipboard operation
firebaseNet copied to clipboard

An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll

Open kaganbzkrt opened this issue 7 years ago • 3 comments

Throw Exception when :

await client.SendMessageAsync(message);

System.NullReferenceException was unhandled Message: An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll Additional information:

but notification was sended succesfully

:

kaganbzkrt avatar Apr 03 '17 09:04 kaganbzkrt

Hi, can you please provide the code you're using to send the nofitications ?

tiagomtotti avatar Jun 10 '17 15:06 tiagomtotti

Happening to me also. Not sure i this helps:

private static async Task<IFCMResponse> SendFCMMessage(string deviceId, Dictionary<string, string> data)
        {
            FCMClient client = new FCMClient("...snip");

            var message = new Message()
            {
                To = deviceId,
                Priority = MessagePriority.high,
                TimeToLive = 30,
                Data = data
            };
           
            return await client.SendMessageAsync(message);

        }  

shawndube avatar Jul 27 '17 03:07 shawndube

Actually, my current NPE is in: Exception thrown: 'System.NullReferenceException' in System.Web.dll but i've seen it say mscorelib also.

shawndube avatar Jul 27 '17 03:07 shawndube