Push notifications crash app in foreground


Hi, there!

We have an Ionic app which receives push notifications from Firebase. The problem is that when I send a push notification and the app is in foreground, it stops working and exits, but when it’s running in background, gets the notification with no problem at all.

I have this issue with both cordova-plugin-fcm (Firebase) and onesignal-cordova-plugin (OneSignal), completely different services. How could I fix this?

Thanks for your help!