diff --git a/README.md b/README.md index f8aadd0c..e303ca14 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,10 @@ If you want to use the app with your own server and want web push notification t * Register at https://firebase.google.com/, set up the project if you have not done so already. * Follow instructions to create a web application https://support.google.com/firebase/answer/9326094 in your project. -* Follow instructions at https://support.google.com/firebase/answer/7015592 to get a Firebase configuration object. -* Locate `firebase-init.js` in the root folder of your copy of TinodeWeb app. Copy-paste configuration object to `firebase-init.js`. Copy `Web Push certificate` (Project Settings -> Cloud Messaging -> Web configuration -> Web Push certificates) to `messagingVapidKey` field. +* Follow instructions at https://support.google.com/firebase/answer/7015592 to get a Firebase configuration object ("Firebase SDK snippet"). +* Locate `firebase-init.js` in the root folder of your copy of TinodeWeb app. Copy-paste the following keys from the configuration object to `firebase-init.js`: `apiKey`, `messagingSenderId`, `projectId`, `appId` (you may copy all keys). +* Copy `Web Push certificate` (Project Settings -> Cloud Messaging -> Web configuration -> Web Push certificates) to `messagingVapidKey` field in `firebase-init.js`. +* Double check that `firebase-init.js` contains the following keys: `apiKey`, `messagingSenderId`, `projectId`, `appId`, `messagingVapidKey`. The file may contain other optional keys. * Copy Google-provided server key to `tinode.conf`, see details [here](https://github.com/tinode/chat/blob/master/docs/faq.md#q-how-to-setup-fcm-push-notifications). ## Responsive design diff --git a/firebase-init.js b/firebase-init.js index 169b0110..e683f3cd 100644 --- a/firebase-init.js +++ b/firebase-init.js @@ -1,12 +1,13 @@ // Get these values for your project from the https://console.firebase.google.com/ const FIREBASE_INIT = { // Set up a web application in console then get the config object. + // The following keys are copied from the object: apiKey: "AIzaSyD6X4ULR-RUsobvs1zZ2bHdJuPz39q2tbQ", messagingSenderId: "114126160546", projectId: "tinode-1000", appId: "1:114126160546:web:aca6ea2981feb81fb44dfb", // Project Settings -> Cloud Messaging -> Web configuration -> Web Push certificates. - // This value IS NOT included in the generated js config you can download from + // This value IS NOT included in the generated js config you get from // the firebase console. It needs to be added separately. messagingVapidKey: "BOgQVPOMzIMXUpsYGpbVkZoEBc0ifKY_f2kSU5DNDGYI6i6CoKqqxDd7w7PJ3FaGRBgVGJffldETumOx831jl58" };