dpa99c / cordova-plugin-firebasex-test

A Cordova app project to test cordova-plugin-firebasex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FirebasePlugin.getToken returns null

bgirschig opened this issue · comments

I've tried following the instructions for building this test project for android, and although I get a working build, I have problems:

  • FirebasePlugin.getToken returns null (firebasex readme warns Note that token will be null if it has not been established yet, but I'm not sure what that means)
  • Creating & Sending notifications from firebase console's cloud messaging tab, nothing happens on the app (wether it is in foreground, background or closed)

Have you changed the app package ID and replaced google-services.json to match the app configuration for your Firebase project?

The Firebase token will be null on the first run after installation until such time as the Firebase SDK has created it, at which time it will call onTokenRefresh. Subsequent calls to getToken() will then return the actual token.
If you are not getting a token at all, it indicates a problem with your Firebase configuration.
I use this test project to test and validate the plugin continuously so the problem does not lie within this project or the firebasex plugin.

Ok, Thanks for the reply, I'll check my firebase config.

The Firebase token will be null on the first run after installation until such time as the Firebase SDK has created it, at which time it will call onTokenRefresh. Subsequent calls to getToken() will then return the actual token.
If you are not getting a token at all, it indicates a problem with your Firebase configuration.
I use this test project to test and validate the plugin continuously so the problem does not lie within this project or the firebasex plugin.

I have change the firebase account and replace the new configuration file and remove the platform and add it again but still getting null token