Module: Hertz::Fcm

Defined in:
lib/hertz/fcm.rb,
lib/hertz/fcm/engine.rb,
lib/hertz/fcm/version.rb,
lib/generators/hertz/fcm/install_generator.rb,
app/jobs/hertz/fcm/notification_delivery_job.rb

Defined Under Namespace

Classes: Engine, InstallGenerator, NotificationDeliveryJob

Constant Summary collapse

VERSION =
'1.2.0'

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Hertz::Fcm)

    the object that the method was called on



15
16
17
18
19
20
21
# File 'lib/hertz/fcm.rb', line 15

def configure
  yield(self)

  FirebaseCloudMessenger.project_id = project_id
  ENV['GOOGLE_PRIVATE_KEY'] = google_private_key
  ENV['GOOGLE_CLIENT_EMAIL'] = google_client_email
end

.deliver_notification(notification) ⇒ Object



23
24
25
# File 'lib/hertz/fcm.rb', line 23

def deliver_notification(notification)
  Hertz::Fcm::NotificationDeliveryJob.perform_later(notification)
end