EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

[iOS] TypeError: Cannot set property 'delegate' of null #1837

Closed phenric closed 3 years ago

phenric commented 3 years ago

When I'm using Nativescript with Firebase for pushing notification I've an issue on iOS but not on Android:

TypeError: Cannot set property 'delegate' of null

The error comes from the module in the messaging.ios.js file. In the _registerForRemoteNotifications method, the line 351 fails with

FIRMessaging.messaging().delegate = _firebaseRemoteMessageDelegate;

I follow the guide of this repo and since I'm using Angular I settle the notification in app.component.ts as explained here https://github.com/EddyVerbruggen/nativescript-plugin-firebase#angular.

Does someone has an idea on how I could solve this?