This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node.js on RPI3 | |
'use strict'; | |
const request = require('superagent'); | |
const FCM_URL = 'https://fcm.googleapis.com/fcm/send'; | |
const FCM_SERVER_KEY = 'YOUR_FCM_SERVER_KEY'; | |
const MSG_TITLE = 'fcm-https.js'; | |
if (process.argv.length < 3) { | |
console.log('Usage: node fcm-https.js FIREBASE_INSTANCE_ID_TOKEN [MESSAGE]'); | |
process.exit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Notify Target ARN for Android device | |
'use strict'; | |
const AWS = require('aws-sdk'); | |
const sns = new AWS.SNS({ | |
apiVersion: '2010-03-31', | |
region: 'MY_REGION' | |
}); | |
if (process.argv.length < 3) { | |
console.log('Usage: node notify.js ENDPOINT_ARN'); | |
process.exit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Firebase Instance ID token to SNS target ARN | |
'use strict'; | |
const AWS = require('aws-sdk'); | |
const sns = new AWS.SNS({ | |
apiVersion: '2010-03-31', | |
region: 'MY_SNS_REGION' | |
}); | |
if (process.argv.length < 3) { | |
console.log('Usage: node add-endpoint.js FIREBASE_INSTACE_ID_TOKEN'); | |
process.exit(); |