How to use Firebase with Ruby on Rails?

I looked at various ruby ​​stones such as firebase-ruby and rest-firebase , but gems do not integrate well with rails.

My question is: is there an easier way to use ApplicationRecord template with Firebase as my backend?

+5
source share
1 answer

First, you need to get two things
1) FIREBASE_SERVER_API_KEY
2) FIREBASE_NOTIFICATION_URL .

After that just pass them in the headers

{"Authorization" => "key=#{FIREBASE_SERVER_API_KEY}", "Content-Type" => "application/json"} 

And in the body these

 {"registration_ids": ["pass-device-token"], "priority":"high", "data":{}} 

I also created a tutorial on how to integrate Firebase with ruby ​​on rails.

+10
source

Source: https://habr.com/ru/post/1261171/


All Articles