jpush 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47fddea1a44db9bbcb1b6a7645baaff34b0ac904
4
- data.tar.gz: 2d3ea559cd6f9c9b3b2e51dd716e498d8ada1346
3
+ metadata.gz: ef3f165440707f88d54f97c3a26a830f8c7e602e
4
+ data.tar.gz: 3f4053c74cca86f5475bf89ed86f944fa93bf30b
5
5
  SHA512:
6
- metadata.gz: e1385cd92de2cdfc617548b83f1b86c7d0b58983941fca8f97a4fb74fa8ca18a729331155c651e3b6e2b3b8ec82c0057737167741bdbd00bdf0dd2bedb2747b2
7
- data.tar.gz: 34fbb08d868c40a888903d3d7ed81ad931c4bc85d2b7cb53856b409c73f16881c362445abf83128bb6d41fc7d57f68b79fc81f430bc0aa58e05bef29305160a3
6
+ metadata.gz: 0933ee30d52eba67458f52f37f6301946fadaffefea88587a2e5127f8efb3e8eee2fe1ebe7028daec3293caf5ede01f049ca60e2ee9be7d9b7067be143258f9a
7
+ data.tar.gz: 5d34e9f8fe631989f19c161e44be53aa69a51b13d5604506999c6ff794c942c9dd475a509d2877de69d9752358bc56b667dd92dd1f64bbf89a63cfef3b468d8e
@@ -129,7 +129,7 @@ notification.set_ios(
129
129
  sound: sound,
130
130
  badge: badge,
131
131
  contentavailable: contentavailable,
132
- mutableavailable: mutableavailable,
132
+ mutablecontent: mutablecontent,
133
133
  category: category,
134
134
  extras: extras
135
135
  )
@@ -143,7 +143,7 @@ notification.set_ios(
143
143
  | sound | 否 | 表示通知提示声音 |
144
144
  | badge | 否 | 表示应用角标,把角标数字改为指定的数字;为 0 表示清除 |
145
145
  | contentavailable | 否 | 表示推送唤醒,仅接受 true 表示为 Background Remote Notification,若不填默认是 nil 表示普通的 Remote Notification |
146
- | mutableavailable | 否 | 表示通知扩展,仅接受 true 表示支持 iOS10 的 UNNotificationServiceExtension,若不填默认是 nil 表示普通的 Remote Notification |
146
+ | mutablecontent | 否 | 表示通知扩展,仅接受 true 表示支持 iOS10 的 UNNotificationServiceExtension,若不填默认是 nil 表示普通的 Remote Notification |
147
147
  | category | 否 | IOS8才支持。设置 APNs payload 中的 'category' 字段值 |
148
148
  | extras | 否 | 表示扩展字段,接受一个 Hash 对象,以供业务使用 |
149
149
 
@@ -162,7 +162,7 @@ notification = JPush::Push::Notification.new.
162
162
  sound: sound,
163
163
  badge: badge,
164
164
  contentavailable: contentavailable,
165
- mutableavailable: mutableavailable,
165
+ mutablecontent: mutablecontent,
166
166
  category: category,
167
167
  extras: extras
168
168
  )
@@ -68,6 +68,7 @@ module JPush
68
68
  raise Utils::Exceptions::OverLimitError.new(name, max_size, unit) if size > max_size
69
69
  end
70
70
 
71
+ # 有效的 tag alias 组成: 字母(区分大小写), 数字, 下划线, 汉字, 特殊字符(@!#$&*+=.|)
71
72
  def ensure_word_valid(name, word)
72
73
  raise Utils::Exceptions::InvalidWordError.new(name, word) unless word.valid_word?
73
74
  end
@@ -31,19 +31,19 @@ module JPush
31
31
  self
32
32
  end
33
33
 
34
- def set_ios(alert: , sound: nil, badge: nil, available: nil, category:nil, extras: nil, contentavailable: nil, mutableavailable: nil)
34
+ def set_ios(alert: , sound: nil, badge: nil, available: nil, category:nil, extras: nil, contentavailable: nil, mutablecontent: nil)
35
35
  contentavailable = available if contentavailable.nil?
36
36
  extras = Notification.build_extras(extras)
37
37
  badge = 0 == badge.to_i ? '0' : badge unless badge.nil?
38
38
  contentavailable = nil unless contentavailable.is_a? TrueClass
39
- mutableavailable = nil unless mutableavailable.is_a? TrueClass
39
+ mutablecontent = nil unless mutablecontent.is_a? TrueClass
40
40
  check_argument(alert: alert, sound: sound, badge: badge, category: category)
41
41
  @ios = {
42
42
  alert: alert,
43
43
  sound: sound,
44
44
  badge: badge,
45
45
  'content-available': contentavailable,
46
- 'mutable-available': mutableavailable,
46
+ 'mutable-content': mutablecontent,
47
47
  category: category,
48
48
  extras: extras
49
49
  }.compact
@@ -33,7 +33,8 @@ module JPush
33
33
 
34
34
  class InvalidWordError < JPushError
35
35
  def initialize(name, word)
36
- super("invalid #{name}: #{word} ( #{name} can only contain letters, numbers, '_' and Chinese character)")
36
+ super("invalid #{name}: #{word} ( #{name} can only contain letters, numbers,
37
+ '_', Chinese character and special characters(@!#$&*+=.|))")
37
38
  end
38
39
  end
39
40
 
@@ -21,7 +21,7 @@ module JPush
21
21
 
22
22
  refine String do
23
23
  BLANK_RE = /\A[[:space:]]*\z/
24
- WORD_RE = /\A[\p{han}a-zA-Z0-9_]+\z/u
24
+ WORD_RE = /\A[\p{han}a-zA-Z0-9_@!#&=|\$\*\+\.]+\z/u
25
25
 
26
26
  def titleize
27
27
  self.split(' ').map(&:capitalize).join(' ')
@@ -1,3 +1,3 @@
1
1
  module JPush
2
- VERSION = "4.0.3"
2
+ VERSION = "4.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jpush
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - JPush Offical
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-31 00:00:00.000000000 Z
11
+ date: 2016-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler