jpush 4.0.2 → 4.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79b65314d47e814e62cfea7b886b27462c7c1c13
4
- data.tar.gz: 1ee47cccb05ec9292d3a6a7227138ba79f1830bc
3
+ metadata.gz: 47fddea1a44db9bbcb1b6a7645baaff34b0ac904
4
+ data.tar.gz: 2d3ea559cd6f9c9b3b2e51dd716e498d8ada1346
5
5
  SHA512:
6
- metadata.gz: b60e7c2e12ff8b4279a24525f100d0834c8bd432498def27ba62be29f8bee086301cbbb2703c4a8aa41697e23e0b6256cc26b7a5846c5d4e230b439227f0cea2
7
- data.tar.gz: e6a7007ad096d5f0db66a166ceec379496c5c13d67d0b126893221d4ab667411c58692ac77ddc400b856605111f209f9c4578a98e4a6c3ff95b688a90e110e7b
6
+ metadata.gz: e1385cd92de2cdfc617548b83f1b86c7d0b58983941fca8f97a4fb74fa8ca18a729331155c651e3b6e2b3b8ec82c0057737167741bdbd00bdf0dd2bedb2747b2
7
+ data.tar.gz: 34fbb08d868c40a888903d3d7ed81ad931c4bc85d2b7cb53856b409c73f16881c362445abf83128bb6d41fc7d57f68b79fc81f430bc0aa58e05bef29305160a3
data/README.md CHANGED
@@ -23,11 +23,11 @@ gem 'jpush', git: 'https://github.com/jpush/jpush-api-ruby-client.git'
23
23
 
24
24
  ## Usage
25
25
 
26
- - [Getting Started](docs/Guides.md#getting-started)
27
- - [Push API](docs/Guides.md#push-api)
28
- - [Report API](docs/Guides.md#report-api)
29
- - [Schedule API](docs/Guides.md#schedule-api)
30
- - [Device API](docs/Guides.md#device-api)
26
+ - [Getting Started](https://github.com/jpush/jpush-api-ruby-client/blob/master/docs/Guides.md#getting-started)
27
+ - [Push API](https://github.com/jpush/jpush-api-ruby-client/blob/master/docs/Guides.md#push-api)
28
+ - [Report API](https://github.com/jpush/jpush-api-ruby-client/blob/master/docs/Guides.md#report-api)
29
+ - [Schedule API](https://github.com/jpush/jpush-api-ruby-client/blob/master/docs/Guides.md#schedule-api)
30
+ - [Device API](https://github.com/jpush/jpush-api-ruby-client/blob/master/docs/Guides.md#device-api)
31
31
 
32
32
  ## Development
33
33
 
@@ -88,7 +88,7 @@ audience = JPush::Push::Audience.new.
88
88
 
89
89
  若通知的内容在各个平台上,都只有 'alert' 这一个最基本的属性,
90
90
  则不需要构建 Notifacation 对象,在新建 PushPayload 对象的时候,给 'notication' 参数直接传递表示 alert 的字符串即可,
91
- 也可以在 Notifacation 对象中设置 alert 属性。
91
+ 也可以在 Notifacation 对象中设置 alert 属性。另外 IOS 的 alert 还支持 Hash 对象的参数。
92
92
  其下属属性包含3种,2个平台属性,以及一个 'alert' 属性。
93
93
 
94
94
  ```ruby
@@ -128,7 +128,8 @@ notification.set_ios(
128
128
  alert: alert,
129
129
  sound: sound,
130
130
  badge: badge,
131
- available: available,
131
+ contentavailable: contentavailable,
132
+ mutableavailable: mutableavailable,
132
133
  category: category,
133
134
  extras: extras
134
135
  )
@@ -140,8 +141,9 @@ notification.set_ios(
140
141
  | --- | :---: | --- |
141
142
  | alert | 是 | 表示通知内容,会覆盖上级统一指定的 alert 信息;内容可以为空字符串,表示不展示到通知栏 |
142
143
  | sound | 否 | 表示通知提示声音 |
143
- | bandge | 否 | 表示应用角标,把角标数字改为指定的数字;为 0 表示清除 |
144
- | available | 否 | 表示推送唤醒,仅接受 true 表示为 Background Remote Notification,若不填默认是 nil 表示普通的 Remote Notification |
144
+ | badge | 否 | 表示应用角标,把角标数字改为指定的数字;为 0 表示清除 |
145
+ | contentavailable | 否 | 表示推送唤醒,仅接受 true 表示为 Background Remote Notification,若不填默认是 nil 表示普通的 Remote Notification |
146
+ | mutableavailable | 否 | 表示通知扩展,仅接受 true 表示支持 iOS10 的 UNNotificationServiceExtension,若不填默认是 nil 表示普通的 Remote Notification |
145
147
  | category | 否 | IOS8才支持。设置 APNs payload 中的 'category' 字段值 |
146
148
  | extras | 否 | 表示扩展字段,接受一个 Hash 对象,以供业务使用 |
147
149
 
@@ -159,7 +161,8 @@ notification = JPush::Push::Notification.new.
159
161
  alert: alert,
160
162
  sound: sound,
161
163
  badge: badge,
162
- available: available,
164
+ contentavailable: contentavailable,
165
+ mutableavailable: mutableavailable,
163
166
  category: category,
164
167
  extras: extras
165
168
  )
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
18
  # delete this section to allow pushing this gem to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
21
  else
22
22
  raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
23
  end
@@ -31,16 +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)
34
+ def set_ios(alert: , sound: nil, badge: nil, available: nil, category:nil, extras: nil, contentavailable: nil, mutableavailable: nil)
35
+ contentavailable = available if contentavailable.nil?
35
36
  extras = Notification.build_extras(extras)
36
37
  badge = 0 == badge.to_i ? '0' : badge unless badge.nil?
37
- available = nil unless available.is_a? TrueClass
38
+ contentavailable = nil unless contentavailable.is_a? TrueClass
39
+ mutableavailable = nil unless mutableavailable.is_a? TrueClass
38
40
  check_argument(alert: alert, sound: sound, badge: badge, category: category)
39
41
  @ios = {
40
42
  alert: alert,
41
43
  sound: sound,
42
44
  badge: badge,
43
- 'content-available': available,
45
+ 'content-available': contentavailable,
46
+ 'mutable-available': mutableavailable,
44
47
  category: category,
45
48
  extras: extras
46
49
  }.compact
@@ -1,3 +1,3 @@
1
1
  module JPush
2
- VERSION = "4.0.2"
2
+ VERSION = "4.0.3"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jpush
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
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-04-29 00:00:00.000000000 Z
11
+ date: 2016-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.11'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '5.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
55
  description: 'JPush''s officially supported Ruby client library for accessing JPush
@@ -60,8 +60,8 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
64
- - .travis.yml
63
+ - ".gitignore"
64
+ - ".travis.yml"
65
65
  - Gemfile
66
66
  - LICENSE.txt
67
67
  - README.md
@@ -94,24 +94,24 @@ homepage: https://github.com/jpush/jpush-api-ruby-client
94
94
  licenses:
95
95
  - MIT
96
96
  metadata:
97
- allowed_push_host: 'TODO: Set to ''http://mygemserver.com'''
97
+ allowed_push_host: https://rubygems.org
98
98
  post_install_message:
99
99
  rdoc_options: []
100
100
  require_paths:
101
101
  - lib
102
102
  required_ruby_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '2.2'
107
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - '>='
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.0.14.1
114
+ rubygems_version: 2.6.8
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: JPush's officially supported Ruby client library for accessing JPush APIs.