Not able to send device push notification due to a

2019-07-27 13:25发布

问题:

I am trying to send device push notification using firebase in cordova (fcm-node plugin for node) using this link ,I have got the device registration token but when I try to send the notification to registered device,getting below error:

{ Error: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "getaddrinfo ENOTFOUND accounts.google.com accounts.google.com:443". at FirebaseAppError.Error (native) at FirebaseAppError.FirebaseError [as constructor] (C:\Users\212606402\Learning\Alert server\pushalert-server\alert-push-notification-server\node_modules\firebase-admin\lib\utils\error.js:25:28) at new FirebaseAppError (C:\Users\212606402\Learning\Alert server\pushalert-server\alert-push-notification-server\node_modules\firebase-admin\lib\utils\error.js:70:23) at C:\Users\212606402\Learning\Alert server\pushalert-server\alert-push-notification-server\node_modules\firebase-admin\lib\firebase-app.js:78:23 at process._tickCallback (internal/process/next_tick.js:103:7) errorInfo: { code: 'app/invalid-credential', message: 'Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "getaddrinfo ENOTFOUND accounts.google.com accounts.google.com:443".' } }

Can anyone please help me what is wrong here.

I saw this thread also but it's a different error.

回答1:

Solution is to update your systems date/time.

For windows system better is to synchronize time with Internet time server.