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
# if you want or need to move off the legacy FCM HTTP endpoints this will get you started | |
# Use googleauth gem to construct JWT token | |
def construct_payload(topic, data, notification = nil) | |
message = { | |
'topic': "fcm_test", | |
# 'token': token, # OR, if you want to send to a specific device | |
'data': { | |
payload: data.to_json # note we can no longer embed objects within data | |
}, |