Programming Firebase with The Prof
Setup a Firebase project on Cloud 9:
- update nvm... $ nvm install 8.1.2
- alias new version... $ nvm alias default 8.1.2
- update npm... npm i -g npm
- install Firebase CLI... $ npm install -g firebase-tools
- create a subdirectory... $ mkdir my-project-name
- cd into new subdirectory
- (if needed) Create project in Firebase console
- credential Firebase... $ firebase login -no-localhost
- initialize Firebase... $ firebase init
- run devserver... $ firebase serve --host 0.0.0.0 --port 8080
---- cURL for testing Cloud Messaging: ----
curl -X POST -H "Authorization: key=YOUR-SERVER-KEY" -H "Content-Type: application/json" -d '{ "notification": { "title": "Test Title", "body": "This is a test cloud message, like it?" }, "to": "YOUR-IID-TOKEN" }' "https://fcm.googleapis.com/fcm/send"