Sha256: c020ded344248de626b6f5eb5b651edf7d450491e8ed7180b4140dc2cd7d90e3

Contents?: true

Size: 455 Bytes

Versions: 8

Compression:

Stored size: 455 Bytes

Contents

module Rpush
  module Client
    module ActiveModel
      module Apns
        class BinaryNotificationValidator < ::ActiveModel::Validator
          MAX_BYTES = 256

          def validate(record)
            return unless record.payload_size > MAX_BYTES
            record.errors[:base] << "APN notification cannot be larger than #{MAX_BYTES} bytes. Try condensing your alert and device attributes."
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rpush-2.0.1-java lib/rpush/client/active_model/apns/binary_notification_validator.rb
rpush-2.0.1 lib/rpush/client/active_model/apns/binary_notification_validator.rb
rpush-2.0.0-java lib/rpush/client/active_model/apns/binary_notification_validator.rb
rpush-2.0.0 lib/rpush/client/active_model/apns/binary_notification_validator.rb
rpush-2.0.0.rc1-java lib/rpush/client/active_model/apns/binary_notification_validator.rb
rpush-2.0.0.rc1 lib/rpush/client/active_model/apns/binary_notification_validator.rb
rpush-2.0.0.beta2 lib/rpush/client/active_model/apns/binary_notification_validator.rb
rpush-2.0.0.beta1 lib/rpush/client/active_model/apns/binary_notification_validator.rb