Skip to content

Instantly share code, notes, and snippets.

View randymxj's full-sized avatar

Xiaojing Ma randymxj

View GitHub Profile
'use strict';
/**
* This is a sample AWS Lambda instance with NodeJS
* Simply sending a POST request to Google Firebase
*/
const AWS = require('aws-sdk');
/**
@randymxj
randymxj / SmartthingsHttpPostJsonToFirebase.groovy
Last active July 10, 2016 21:16
Sending JSON payload from Smartthings SmartApp to Google Firebase Cloud Message
/*
Example of Smartthings SmartApp to send downstream cloud message with Firebase
Event subscription is needed to trigger the event handler
*/
def installed() {
initialize()
}
def updated() {
@randymxj
randymxj / NodeDownstreamFirebaseCloudMessage.js
Last active July 10, 2016 20:52
Node.js request sending downstream POST with Google Firebase Cloud Message
/*
Example of Node.JS to send downstream cloud message with Firebase
NPM package request is needed in this code gist
*/
// Firebase auth key
var serverKey = "Firebase Server Key";
var clientToken= "Client Device Token"
// Payload message data