Created
June 26, 2019 08:28
-
-
Save e-lin/3f258d63578195f2f24798c0b1f870bc to your computer and use it in GitHub Desktop.
Firestore trigger 2 - send answer to Android Thing
This file contains hidden or 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
const payload = { | |
data: { | |
disposition: pic.answer.disposition.toString(), | |
pic_id: picId | |
} | |
} | |
try { | |
const response = await fcm.sendToTopic('answers',payload) | |
console.log('pic ${picId} answer sent:', response) | |
} | |
catch (e) { | |
console.error('pic ${picId} answer error:', e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment