arnesson / cordova-plugin-firebase

Cordova plugin for Google Firebase
http://arnesson.github.io/cordova-plugin-firebase
MIT License
1k stars 1.55k forks source link

Completely unable to get a token or set notification handlers (critical) #1111

Open Zerokk opened 4 years ago

Zerokk commented 4 years ago

Describe the bug The methods to get a token, wait for a new one, or set up handlers for notification click, do not work at all. This also happened me with the simpler, FCM plugin, and I am completely stuck with this issue.

To Reproduce Steps to reproduce the behavior:

  1. Install either this package, or the FCM package with dependencies.
  2. Add it to the module.ts file, as a provider.
  3. Call both of the token-getter methods inside a platform.ready().then() block.

Expected behavior It should retrieve the token, aswell properly register the function handlers for when the notification has been clicked. Notifications should arrive too. They work, but the rest just gives silent errors: absolutely no stacktrace, no error, nothing. I can't provide either a screenshot or console.log because it simply retrieves NO message at all. It works just like this:

errrrarararar

Plugin Version Run cordova plugin list to find out what version of cordova-plugin-firebase you are running with

cordova-plugin-camera 4.0.3 "Camera" cordova-plugin-datepicker 0.9.3 "DatePicker" cordova-plugin-device 2.0.2 "Device" cordova-plugin-file 6.0.1 "File" cordova-plugin-filepath 1.5.1 "cordova-plugin-filepath" cordova-plugin-firebase 2.0.5 "Google Firebase Plugin" cordova-plugin-geolocation 4.0.1 "Geolocation" cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview" cordova-plugin-native-spinner 1.1.3 "Native Spinner" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-statusbar 2.4.2 "StatusBar" cordova-plugin-telerik-imagepicker 2.2.4 "ImagePicker" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-support-google-services 1.3.1 "cordova-support-google-services" phonegap-plugin-multidex 1.0.0 "Multidex"

As it is an Ionic project, I will also put here the ionic info dump:

`Ionic:

Ionic CLI : 5.2.5 (C:\Users\zerok\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.0.0 @angular-devkit/build-angular : 0.12.4 @angular-devkit/schematics : 7.3.0 @angular/cli : 7.1.0 @ionic/angular-toolkit : 1.3.0

Cordova:

Cordova CLI : not installed Cordova Platforms : android 7.1.4 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 14 other plugins)

Utility:

cordova-res : 0.6.0 native-run : not installed

System:

NodeJS : v11.8.0 (C:\Program Files\nodejs\node.exe) npm : 6.5.0 OS : Windows 10`

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Tried using LocalNotifications too, but they just won't work properly, since the plugin is totally broke.

I've been fighting with this same issue, both with this plugin and FCM's for three days long. I don't lie if I tell you that I already had an anxiety attack last night because of this. I've been developing an app for the latest 9 months, for a serious project of my own, and this app needs push notifications for one of it's core functions. Therefore, all 9 months of work are worth nothing if I don't manage this to work.

And all progress gets stale when I manage to install these plugin's dependencies and everything, but in the end, I get these silent errors that lead me to nowhere. I just can't understand what's going on, nor find any info, so please, I'm really begging you guys for some help here. This issue is serious and is really making me sick of software development. This is by far my biggest crisis as a developer, and I will really appreciate all efforts done to get it fixed.

Thank you for reading me. Hopefully we can find a fix!

Zerokk commented 4 years ago

I just realized that I can't call any Firebase method at all, something very similar to what happened me with the FCM plugin. Calling any method of Firebase will not throw any error, any log, any stacktrace. This is what bugs me the most.

edit: my latest codebase is very similar to the one in this tutorial, which I followed: https://www.freecodecamp.org/news/how-to-get-push-notifications-working-with-ionic-4-and-firebase-ad87cc92394e/#1-package-installation