Sha256: 9c11e401cdb3005c31aac869aaf0c1a0ee12482af80602ec1d9d1ba692fa5558

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

module PushToSNS
  class AndroidPushNotification < BasicPushNotification
    def message
      { GCM: { data: default_payload.deeper_merge(payload) }.to_json }
    end

    private

    def default_payload
      basic_payload = {}
      basic_payload[:title] = payload[:title] if payload[:title]
      basic_payload[:message] = payload[:message] if payload[:message]
      basic_payload[:smallIcon] = payload[:small_icon] if payload[:small_icon]
      basic_payload[:sound] = payload[:sound] if payload[:sound]
      basic_payload[:image] = payload[:image] if payload[:image]
      basic_payload[:notId] = payload[:notification_id] if payload[:notification_id]

      basic_payload
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
push_to_sns-0.6.0 lib/push_to_sns/android_push_notification.rb