jpush 4.0.3 → 4.0.4
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.
- checksums.yaml +4 -4
- data/docs/Guides.md +3 -3
- data/lib/jpush/helper/argument.rb +1 -0
- data/lib/jpush/push/notification.rb +3 -3
- data/lib/jpush/utils/exceptions.rb +2 -1
- data/lib/jpush/utils/helper.rb +1 -1
- data/lib/jpush/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef3f165440707f88d54f97c3a26a830f8c7e602e
|
4
|
+
data.tar.gz: 3f4053c74cca86f5475bf89ed86f944fa93bf30b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0933ee30d52eba67458f52f37f6301946fadaffefea88587a2e5127f8efb3e8eee2fe1ebe7028daec3293caf5ede01f049ca60e2ee9be7d9b7067be143258f9a
|
7
|
+
data.tar.gz: 5d34e9f8fe631989f19c161e44be53aa69a51b13d5604506999c6ff794c942c9dd475a509d2877de69d9752358bc56b667dd92dd1f64bbf89a63cfef3b468d8e
|
data/docs/Guides.md
CHANGED
@@ -129,7 +129,7 @@ notification.set_ios(
|
|
129
129
|
sound: sound,
|
130
130
|
badge: badge,
|
131
131
|
contentavailable: contentavailable,
|
132
|
-
|
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
|
-
|
|
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
|
-
|
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,
|
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
|
-
|
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-
|
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,
|
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
|
|
data/lib/jpush/utils/helper.rb
CHANGED
data/lib/jpush/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|