rpush 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/README.md +7 -1
- data/lib/generators/rpush_migration_generator.rb +1 -0
- data/lib/generators/templates/rpush_2_6_0_updates.rb +10 -0
- data/lib/rpush/cli.rb +2 -0
- data/lib/rpush/client/active_model/gcm/notification.rb +1 -0
- data/lib/rpush/client/active_record/notification.rb +1 -1
- data/lib/rpush/client/mongoid/notification.rb +1 -0
- data/lib/rpush/client/redis/notification.rb +1 -0
- data/lib/rpush/daemon/gcm/delivery.rb +2 -2
- data/lib/rpush/daemon/store/active_record.rb +1 -1
- data/lib/rpush/daemon/wns/delivery.rb +6 -8
- data/lib/rpush/version.rb +1 -1
- data/spec/functional/cli_spec.rb +1 -0
- data/spec/support/active_record_setup.rb +2 -1
- data/spec/unit/client/active_record/gcm/notification_spec.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f3cc8682dd4d0be056e3fdac764d7e611f93d13
|
4
|
+
data.tar.gz: 9d98d267c188c407324808d28d9a3922dbb9b060
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59ee90a994a38a3684baef26510f1bf8befac593c91d691988f729224eeda34129c4965aa3bd8b7ed7db2b2c4288087bf11372c4089b73c90a77e78706fc56f4
|
7
|
+
data.tar.gz: c6d83831032136982317afe65731d0c0f56c2c568ce8c5c27ad96e5cb0b573587615d09fa36da7791999e78c652f8f2b05808a1c266e67f19025e3cb9a3b8ba5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## 2.6.0 (Jan 25, 2016)
|
2
|
+
|
3
|
+
#### Features
|
4
|
+
|
5
|
+
* Added support for GCM for iOS' `content_available`. ([#221](https://github.com/rpush/rpush/pull/221))
|
6
|
+
|
7
|
+
#### Fixes
|
8
|
+
|
9
|
+
* Fix typo in Oracle support. ([#185](https://github.com/rpush/rpush/pull/185))
|
10
|
+
* Remove `param` tag from WNS message. ([#190](https://github.com/rpush/rpush/pull/190))
|
11
|
+
* Fixed WNS response headers parser. ([#192](https://github.com/rpush/rpush/pull/192))
|
12
|
+
* GCM: fixed raise of unhandled errors. ([#193](https://github.com/rpush/rpush/pull/193))
|
13
|
+
* Fix issue with custom PID file set in `Rpush.config`. ([#224](https://github.com/rpush/rpush/pull/224), [#225](https://github.com/rpush/rpush/pull/225))
|
14
|
+
|
1
15
|
## 2.5.0 (July 19, 2015)
|
2
16
|
Features:
|
3
17
|
* Add 'rpush status' to inspect running Rpush internal status.
|
@@ -10,7 +24,7 @@
|
|
10
24
|
* Fix for handling APNs error when using `rpush push` or `Rpush.push`.
|
11
25
|
* Fix backwards compatibility issue with ActiveRecord (#144).
|
12
26
|
|
13
|
-
## 2.4.0 (
|
27
|
+
## 2.4.0 (Feb 18, 2015)
|
14
28
|
Features:
|
15
29
|
* Support for MongoDB (using Mongoid).
|
16
30
|
* config.feedback_poll is now deprecated, use config.apns.feedback_receiver.frequency instead.
|
data/README.md
CHANGED
@@ -119,6 +119,8 @@ For more documentation on [ADM](https://developer.amazon.com/sdk/adm.html).
|
|
119
119
|
```ruby
|
120
120
|
app = Rpush::Wpns::App.new
|
121
121
|
app.name = "windows_phone_app"
|
122
|
+
app.client_id = # Get this from your apps dashboard https://dev.windows.com
|
123
|
+
app.client_secret = # Get this from your apps dashboard https://dev.windows.com
|
122
124
|
app.connections = 1
|
123
125
|
app.save!
|
124
126
|
```
|
@@ -175,6 +177,10 @@ end
|
|
175
177
|
|
176
178
|
Call this during startup of your application, for example, by adding it to the end of `config/rpush.rb`. See [Embedding API](https://github.com/rpush/rpush/wiki/Embedding-API) for more details.
|
177
179
|
|
180
|
+
#### Using mina
|
181
|
+
|
182
|
+
If you're using [mina](https://github.com/mina-deploy/mina), there is a gem called [mina-rpush](https://github.com/d4rky-pl/mina-rpush) which helps you control rpush.
|
183
|
+
|
178
184
|
### Configuration
|
179
185
|
|
180
186
|
See [Configuration](https://github.com/rpush/rpush/wiki/Configuration) for a list of options.
|
@@ -216,7 +222,7 @@ You should run `rpush init` after upgrading Rpush to check for configuration and
|
|
216
222
|
|
217
223
|
When running specs, please note that the ActiveRecord adapter can be changed by setting the `ADAPTER` environment variable. For example: `ADAPTER=postgresql rake`.
|
218
224
|
|
219
|
-
Available adapters for testing are `
|
225
|
+
Available adapters for testing are `postgresql`, `jdbcpostgresql`, `mysql2`, `jdbcmysql`, `jdbch2`, and `sqlite3`.
|
220
226
|
|
221
227
|
Note that the database username is changed at runtime to be the currently logged in user's name. So if you're testing
|
222
228
|
with mysql and you're using a user named 'bob', you will need to grant a mysql user 'bob' access to the 'rpush_test'
|
data/lib/rpush/cli.rb
CHANGED
@@ -16,7 +16,7 @@ module Rpush
|
|
16
16
|
attr_accessible :badge, :device_token, :sound, :alert, :data, :expiry, :delivered,
|
17
17
|
:delivered_at, :failed, :failed_at, :error_code, :error_description, :deliver_after,
|
18
18
|
:alert_is_json, :app, :app_id, :collapse_key, :delay_while_idle, :registration_ids,
|
19
|
-
:uri, :url_args, :category
|
19
|
+
:uri, :url_args, :category, :content_available
|
20
20
|
end
|
21
21
|
|
22
22
|
def data=(attrs)
|
@@ -5,7 +5,7 @@ module Rpush
|
|
5
5
|
class Delivery < Rpush::Daemon::Delivery
|
6
6
|
include MultiJsonHelper
|
7
7
|
|
8
|
-
host = 'https://
|
8
|
+
host = 'https://gcm-http.googleapis.com'
|
9
9
|
GCM_URI = URI.parse("#{host}/gcm/send")
|
10
10
|
UNAVAILABLE_STATES = %w(Unavailable InternalServerError)
|
11
11
|
INVALID_REGISTRATION_ID_STATES = %w(InvalidRegistration MismatchSenderId NotRegistered InvalidPackageName)
|
@@ -44,7 +44,7 @@ module Rpush
|
|
44
44
|
when 503
|
45
45
|
service_unavailable(response)
|
46
46
|
else
|
47
|
-
fail Rpush::DeliveryError.new(response.code, @notification.id, Rpush::Daemon::HTTP_STATUS_CODES[response.code.to_i])
|
47
|
+
fail Rpush::DeliveryError.new(response.code.to_i, @notification.id, Rpush::Daemon::HTTP_STATUS_CODES[response.code.to_i])
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -206,7 +206,7 @@ module Rpush
|
|
206
206
|
|
207
207
|
def claim(relation)
|
208
208
|
notifications = relation.lock(true).to_a
|
209
|
-
@using_oracle ?
|
209
|
+
@using_oracle ? notifications.sort_by(&:created_at) : notifications
|
210
210
|
end
|
211
211
|
|
212
212
|
def adapter_name
|
@@ -145,26 +145,24 @@ module Rpush
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def status_from_response(response)
|
148
|
-
headers = response.to_hash
|
148
|
+
headers = response.to_hash.inject({}) {|h, v| h[v[0].downcase] = v[1]; h}
|
149
149
|
{
|
150
|
-
notification: headers["
|
151
|
-
device_connection: headers["
|
152
|
-
msg_id: headers["
|
153
|
-
error_description: headers["
|
154
|
-
debug_trace: headers["
|
150
|
+
notification: headers["x-wns-status"],
|
151
|
+
device_connection: headers["x-wns-deviceconnectionstatus"],
|
152
|
+
msg_id: headers["x-wns-msg-id"],
|
153
|
+
error_description: headers["x-wns-error-description"],
|
154
|
+
debug_trace: headers["x-wns-debug-trace"]
|
155
155
|
}
|
156
156
|
end
|
157
157
|
|
158
158
|
def notification_to_xml
|
159
159
|
title = clean_param_string(@notification.data['title']) if @notification.data['title'].present?
|
160
160
|
body = clean_param_string(@notification.data['body']) if @notification.data['body'].present?
|
161
|
-
param = clean_param_string(@notification.data['param']) if @notification.data['param'].present?
|
162
161
|
"<toast>
|
163
162
|
<visual version='1' lang='en-US'>
|
164
163
|
<binding template='ToastText02'>
|
165
164
|
<text id='1'>#{title}</text>
|
166
165
|
<text id='2'>#{body}</text>
|
167
|
-
<param>#{param}</param>
|
168
166
|
</binding>
|
169
167
|
</visual>
|
170
168
|
</toast>"
|
data/lib/rpush/version.rb
CHANGED
data/spec/functional/cli_spec.rb
CHANGED
@@ -29,8 +29,9 @@ ActiveRecord::Base.establish_connection(db_config[SPEC_ADAPTER])
|
|
29
29
|
require 'generators/templates/add_rpush'
|
30
30
|
require 'generators/templates/rpush_2_0_0_updates'
|
31
31
|
require 'generators/templates/rpush_2_1_0_updates'
|
32
|
+
require 'generators/templates/rpush_2_6_0_updates'
|
32
33
|
|
33
|
-
migrations = [AddRpush, Rpush200Updates, Rpush210Updates]
|
34
|
+
migrations = [AddRpush, Rpush200Updates, Rpush210Updates, Rpush260Updates]
|
34
35
|
|
35
36
|
unless ENV['TRAVIS']
|
36
37
|
migrations.reverse_each do |m|
|
@@ -31,4 +31,9 @@ describe Rpush::Client::ActiveRecord::Gcm::Notification do
|
|
31
31
|
notification.expiry = 100
|
32
32
|
expect(notification.as_json['time_to_live']).to eq 100
|
33
33
|
end
|
34
|
+
|
35
|
+
it 'includes content_available in the payload' do
|
36
|
+
notification.content_available = true
|
37
|
+
expect(notification.as_json['content_available']).to eq true
|
38
|
+
end
|
34
39
|
end if active_record?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Leitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/generators/templates/rpush.rb
|
129
129
|
- lib/generators/templates/rpush_2_0_0_updates.rb
|
130
130
|
- lib/generators/templates/rpush_2_1_0_updates.rb
|
131
|
+
- lib/generators/templates/rpush_2_6_0_updates.rb
|
131
132
|
- lib/rpush.rb
|
132
133
|
- lib/rpush/apns_feedback.rb
|
133
134
|
- lib/rpush/cli.rb
|