Method: InovaFCM::Service#initialize
- Defined in:
- lib/inova_fcm/service.rb
#initialize(registration_ids: [], notification: {}, data: {}, topic: SecureRandom.uuid + Time.now.to_i.to_s) ⇒ Service
Returns a new instance of Service.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/inova_fcm/service.rb', line 10 def initialize(registration_ids: [], notification: {}, data: {}, topic: SecureRandom.uuid + Time.now.to_i.to_s) @topic = topic @registration_ids = registration_ids.uniq @notification = notification @data = data InovaFCM.configuration.validate! @fcm = FCM.new(InovaFCM.configuration.fcm_key, InovaFCM.configuration.firebase_admin_sdk_path, InovaFCM.configuration.firebase_project_id) validate_attributes! end |