Class: Push::Apns::BinaryNotificationValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/push/apns/binary_notification_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



5
6
7
8
9
# File 'lib/push/apns/binary_notification_validator.rb', line 5

def validate(record)
  if record.payload_size > 256
    record.errors[:base] << "APN notification cannot be larger than 256 bytes. Try condensing your alert and device attributes."
  end
end