lib/push0r/APNS/ApnsPushMessage.rb
# Convenience method to attach common data (that is an alert, a sound or a badge value) to this message's payload.
# @param alert_text [String] the alert text to be displayed
# @param sound [String] the sound to be played
# @param badge [Fixnum] the badge value to be displayed
# @param category [String] the category this message belongs to (see UIUserNotificationCategory in apple's documentation)
Convenience method to attach common data (that is an alert, a sound or a badge value) to this message's payload.
Convenience method to attach common data ( that is an alert a sound or a badge value ) to this message ' s payload .
def simple(alert_text = nil, sound = nil, badge = nil, category = nil)
      new_payload = {aps: {}}
      if alert_text
        new_payload[:aps][:alert] = alert_text
      end
      if sound
        new_payload[:aps][:sound] = sound
      end
      if badge
        new_payload[:aps][:badge] = badge
      end
      if category
        new_payload[:aps][:category] = category
      end
      @payload.merge!(new_payload)
      return self
    end
def simple ( alert_text = nil , sound = nil , badge = nil , category = nil ) new_payload = { aps : { } } if alert_text new_payload [ :aps ] [ :alert ] = alert_text end if sound new_payload [ :aps ] [ :sound ] = sound end if badge new_payload [ :aps ] [ :badge ] = badge end if category new_payload [ :aps ] [ :category ] = category end @payload . merge! ( new_payload ) return self end
Convenience method to attach common data (that is an alert, a sound or a badge value) to this message's payload.
Convenience method to attach common data ( that is an alert a sound or a badge value ) to this message ' s payload .
alert_text
the alert text to be displayed
the alert text to be displayed
sound
the sound to be played
the sound to be played
badge
the badge value to be displayed
the badge value to be displayed
category
the category this message belongs to
the category this message belongs to