Skip to content

Instantly share code, notes, and snippets.

View kashua14's full-sized avatar
🏠
Working from home

Kasasira Joshua kashua14

🏠
Working from home
View GitHub Profile
@mitchtabian
mitchtabian / index.js
Created April 19, 2018 16:59
Cloud Function for sending a chat message
let functions = require('firebase-functions');
let admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.sendNotification = functions.database.ref('/chatrooms/{chatroomId}/chatroom_messages/{chatmessageId}')
.onWrite((snap, context) => {
console.log("System: starting");