rpush: NameError: uninitialized constant Rpush::Fcm (NameError)

Describe the bug Hello everyone, we are migrating from Gcm to Fcm after getting this error message:

[ERROR] Rpush::DeliveryError, Unable to deliver notification 19929, received error (Failed to deliver to all recipients. Errors: DeprecatedApi.)

But after using Rpush::Fcm::App.new we are getting en error:

NameError: uninitialized constant Rpush::Fcm (NameError) fcm_app = Rpush::Fcm::App.new Did you mean? Rpush::Gcm

To Reproduce Steps to reproduce the behavior:

  1. Snipped code of the rake task:
    fcm_app = Rpush::Fcm::App.new
    fcm_app.name = "android"
    fcm_app.firebase_project_id = ENV['FIREBASE_PROJECT']
    fcm_app.json_key = ENV['RPUSH_FCM_JSON_KEY']
    fcm_app.connections = 30
    fcm_app.save!
  1. Run the rake task
  2. Get error:

NameError: uninitialized constant Rpush::Fcm (NameError)

fcm_app = Rpush::Fcm::App.new
               ^^^^^

Did you mean? Rpush::Gcm

Expected behavior We expected to not get this error, since this Rpush::Fcm::App.new is mentioned into the README section of Rpush gem.

Additional context It is quite urgent for us to address this problem because we don’t have the time to re write the code using another solution.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 23

Commits related to this issue

Most upvoted comments

What about the 7.0.1, we are having exactly the same issue.

FCM support is not yet released, you have to use the master branch for now. See #665

/cc @aried3r

changing to master branch:

remote: https://github.com/rpush/rpush.git revision: ef13b40096577e93334a8153205ac1cb934219be branch: master specs: rpush (7.0.1) activesupport (>= 5.2, < 7.1.0) googleauth jwt (>= 1.5.6) multi_json (~> 1.0) net-http-persistent net-http2 (~> 0.18, >= 0.18.3) railties rainbow thor (>= 0.18.1, < 2.0) web-push

Not working either.