How to use Firebase with Ruby on Rails?

后端 未结 1 1596
既然无缘
既然无缘 2021-02-05 23:32

I\'ve looked at different ruby gems like firebase-ruby and rest-firebase, but the gems don\'t integrate well with rails.

My question is, is there an easier way of using

相关标签:
1条回答
  • 2021-02-06 00:15

    Firstly you need to get two things

    1. FIREBASE_SERVER_API_KEY
    2. FIREBASE_NOTIFICATION_URL.

    After that just pass these in headers

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

    And in body pass these

    {"registration_ids":
    ["pass-device-token"],
    "priority":"high",
    "data":{}}
    
    0 讨论(0)
提交回复
热议问题