本文介绍了如何在Ruby on Rails中使用Firebase?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
FIREBASE_SERVER_API_KEY
FIREBASE_NOTIFICATION_URL .
FIREBASE_SERVER_API_KEY
FIREBASE_NOTIFICATION_URL.
我看过不同的红宝石,例如 firebase-ruby 和 rest-firebase ,但宝石没有与rails很好地集成.
I've looked at different ruby gems like firebase-ruby and rest-firebase, but the gems don't integrate well with rails.
我的问题是,有没有更简单的方法将ApplicationRecord设计模式与Firebase用作后端?
My question is, is there an easier way of using the ApplicationRecord design pattern with Firebase as my backend?
推荐答案首先,您需要获得两件事
Firstly you need to get two things
之后,只需在标题中传递这些内容
After that just pass these in headers
{"Authorization" => "key=#{FIREBASE_SERVER_API_KEY}", "Content-Type" => "application/json"}然后通过这些
{"registration_ids": ["pass-device-token"], "priority":"high", "data":{}}更多推荐
如何在Ruby on Rails中使用Firebase?
发布评论