In recent days, i have encountered a few problems with my old firebase sdk's in both android and server node js 'firebase' sdk. Sending notifications and retrieving data.
After i updated android dependencies with newest version, notification problem was solved.
But in server side:
var admin = require("firebase-admin");
var serviceAccount = require("filepath.json");
var db = admin.database();
var ref = db.ref("myval");
Solved the problem with help of firebase team.
Enabling the logging before database definition with:
admin.database.enableLogging(true); var db = admin.database();
helps for debugging. After that I got the error:
Failed to get token: Error: Error fetching access token: invalid_grant (Invalid JWT: Token must be a short-lived token and in a reasonable timeframe)
And according to this: Authentication on google: OAuth2 keeps returning 'invalid_grant' my machine timezone was not syncronized appropriately with a ntp server, which is required for new admin authentication in my case.
Then (in ubuntu 14.04) setting the timezone (timezones are here: '$ timedatectl list-timezones') :
$ sudo timedatectl set-timezone desired_timezone
solved the problem!
Thanks for helps.