Sha256: aa4cf2ba410eb3423a4dddfd06088c7adeede4545d616d00d9eb73fc7f071e1a

Contents?: true

Size: 422 Bytes

Versions: 4

Compression:

Stored size: 422 Bytes

Contents

module JeraPush::Services
  class TopicService < JeraPush::Services::BaseService
    DEFAULT_TOPIC = 'general'

    def initialize(*)
      super
    end

    def subscribe(device:, topic: DEFAULT_TOPIC)
      @firebase.add_device_to_topic(device: device, topic: topic)
    end

    def unsubscribe(device:, topic: DEFAULT_TOPIC)
      @firebase.remove_device_from_topic(devices: [device], topic: topic)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jera_push-2.1.4 lib/jera_push/services/topic_service.rb
jera_push-2.1.3 lib/jera_push/services/topic_service.rb
jera_push-2.1.2 lib/jera_push/services/topic_service.rb
jera_push-2.0.0 lib/jera_push/services/topic_service.rb