dr-apns 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/apns/core.rb +6 -0
  2. metadata +2 -2
data/lib/apns/core.rb CHANGED
@@ -135,8 +135,14 @@ module APNS
135
135
 
136
136
  def self.packaged_message(message)
137
137
  if message.is_a?(Hash)
138
+ if message.to_json.bytesize > 256
139
+ raise "Message(json) bytesize > 256"
140
+ end
138
141
  message.to_json
139
142
  elsif message.is_a?(String)
143
+ if message.bytesize > 256
144
+ raise "Message bytesize > 256"
145
+ end
140
146
  '{"aps":{"alert":"'+ message + '"}}'
141
147
  else
142
148
  raise "Message needs to be either a hash or string"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dr-apns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire: apns
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-10 00:00:00.000000000 Z
12
+ date: 2012-06-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Simple Apple push notification service gem
15
15
  email: dongriab@gmail.com