Last active
March 26, 2018 07:53
-
-
Save gyosit/060946fcb345ca9f87a05094df155748 to your computer and use it in GitHub Desktop.
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
post '/send' do #外部からPOST通信を受ける | |
users = User.all #User…UserIdを保存しているDB | |
users.each{ |user| #DBに登録されている全てのユーザに | |
message = {type: 'text', text: params[:msg]} #POSTのパラメータにメッセージを乗せる | |
client.push_message(user.userId, message) #PUSH送信 | |
} | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment