what is "serviceAccountKey.json" referring to in the Firebase device-to-device notifications tutorial

467 views
Skip to first unread message

Entman via StackOverflow

unread,
Jan 26, 2017, 8:21:04 AM1/26/17
to google-appengin...@googlegroups.com

So basically, i managed to go through the complete Firebase Android Codelab ( https://codelabs.developers.google.com/codelabs/firebase-android/ ) without too much problem, the app works perfectly. Now for fun purposes i would like to add device-to-device notifications. I found this tutorial : https://firebase.googleblog.com/2016/08/sending-notifications-between-android.html And some things are not clear to me.

  1. In the node script there is a line like this:

var serviceAccount = require("path/to/serviceAccountKey.json");

What is the "ServiceAccountKey.json" file? Is it just another name for google-services.json? If not, what is this?

  1. Is there a simple "click through" tutorial how to deploy the node server code to the google environment?

Thx in advance.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/41874398/what-is-serviceaccountkey-json-referring-to-in-the-firebase-device-to-device-n

Entman via StackOverflow

unread,
Jan 26, 2017, 8:31:03 AM1/26/17
to google-appengin...@googlegroups.com

I managed to go through the complete Firebase Android Codelab without too much problem, the app works perfectly. Now I would like to add device-to-device notifications. I found this tutorial: And some things are not clear to me.

  1. In the node script there is a line like this:

var serviceAccount = require("path/to/serviceAccountKey.json");

What is the "ServiceAccountKey.json" file? Is it just another name for google-services.json? If not, what is this?

  1. Is there a simple "click through" tutorial how to deploy the node server code to the google environment?


Frank van Puffelen via StackOverflow

unread,
Jan 26, 2017, 8:31:05 AM1/26/17
to google-appengin...@googlegroups.com

In the blog post you're following, we're running the node.js script on Google Cloud's App Engine Flexible Environment. A service account is a way to give trusted processes access to Google Cloud Platform and Firebase resources.

You create a service account through the Google Cloud Console and then download the corresponding JSON file. The code in the blog post looks for that file and use it to initialize the Firebase Admin SDK.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/41874398/what-is-serviceaccountkey-json-referring-to-in-the-firebase-device-to-device-n/41874571#41874571
Reply all
Reply to author
Forward
0 new messages