Closed chrwei closed 3 years ago
I found a few problems with this issue:
I'd say start by looking at t.Exception
. If the task faulted, you should be able to get hold of the underling exception this way.
If it looks like a problem with the FCM service, please reach out to Firebase Support and provide details of your project: https://firebase.google.com/support
it certainly could be more clear in the docs than an exception doesn't throw.
looks like all the iOS tokens are coming back unregistered.
Task continuations in C# don't throw. So you must check task.Status
and task.Exception
. You should use await
for conventional exception throw.
try
{
await FirebaseMessaging.DefaultInstance.SendAsync(m);
}
catch (FirebaseMessagingException e)
{
if (e.MessagingErrorCode == MessagingErrorCode.Unregistered)
{
Console.WriteLine("Token unregistered");
}
}
.net 4.6.1, FirebaseAdmin v2.0.0 from nuget
I had this all working about a month ago. At some point it stopped sending iOS notifications, but Android still works.
t
just has an id and status="Faulted".I've tried removing the
AndroidConfig
for ios devices, and I've tried adding anApsAlert
to theAps
, but the result is always the same. I've even tried recreated the service account key, using an apn cert instead of a key, and generating a new apns key. No change for all 3, separately.What can I do to find out what Faulted means, and what's changed to have APNs stop working but Android push keep working?