Skip to content

Commit c9d9d9e

Browse files
author
Humberto Castaneda
committed
There is a crash when a device is registered in FCM.
1. The user setup to receive push notifications. 2. The user doesn't want to receive push notifications (unregister him device from FCM) 3. And then the user tries to register again him device in FCM the pendingTopics stack has some values in null.
1 parent 30ff0ab commit c9d9d9e

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

Plugin.FirebasePushNotification/FirebasePushNotificationManager.ios.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,16 +551,17 @@ public void DidReceiveRegistrationToken(Messaging messaging, string fcmToken)
551551
while (pendingTopics.Count > 0)
552552
{
553553
var pTopic = pendingTopics.Dequeue();
554-
555-
if (pTopic.Item2)
554+
if (pTopic != null)
556555
{
557-
CrossFirebasePushNotification.Current.Subscribe(pTopic.Item1);
558-
}
559-
else
560-
{
561-
CrossFirebasePushNotification.Current.Unsubscribe(pTopic.Item1);
556+
if (pTopic.Item2)
557+
{
558+
CrossFirebasePushNotification.Current.Subscribe(pTopic.Item1);
559+
}
560+
else
561+
{
562+
CrossFirebasePushNotification.Current.Unsubscribe(pTopic.Item1);
563+
}
562564
}
563-
564565
}
565566
}
566567

0 commit comments

Comments
 (0)