Skip to content

NameError: uninitialized constant Rpush::Fcm (NameError) #683

Closed
@ghillahill

Description

@ghillahill

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions