如何在Ruby on Rails中使用Firebase?

编程入门 行业动态 更新时间:2024-10-28 01:17:08
本文介绍了如何在Ruby on Rails中使用Firebase?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我看过不同的红宝石,例如 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

  • FIREBASE_SERVER_API_KEY
  • FIREBASE_NOTIFICATION_URL .
  • FIREBASE_SERVER_API_KEY
  • FIREBASE_NOTIFICATION_URL.
  • 之后,只需在标题中传递这些内容

    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?

    本文发布于:2023-10-29 02:45:23,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1538499.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何在   Ruby   Firebase   Rails

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!