Skip to content

Commit 11aca41

Browse files
committed
Update notification host with right value
Also update readme
1 parent bdb7b39 commit 11aca41

File tree

3 files changed

+14
-25
lines changed

3 files changed

+14
-25
lines changed

README.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,10 @@ end
252252

253253
Pusher now allows sending native notifications to iOS and Android devices. Check out the [documentation](https://pusher.com/docs/push_notifications) for information on how to set up push notifications on Android and iOS. There is no additional setup required to use it with this library. It works out of the box wit the same Pusher instance. All you need are the same pusher credentials.
254254

255-
You can set the `notification_host` globally like so
256-
257-
```ruby
258-
Pusher.notification_host = "<host>.com"
259-
```
260-
The default host is set to `<insert endpoint here>` and is currently the only supported host.
261-
262-
Alternatively, you may set it on an instance of Pusher
263-
264-
```ruby
265-
pusher.notification_host = "<host>.com"
266-
```
267-
268-
You can also set a scheme for the notification host like above by specifying the `notification_scheme` key in the options hash or by setting it globally.
269-
270255
### Sending native pushes
271256

257+
The native notifications API is hosted at `nativepush-cluster1.pusher.com` and only accepts https requests.
258+
272259
You can send pushes by using the `notify` method, either globally or on the instance. The method takes two parameters:
273260

274261
- `interests`: An Array of strings which represents the interests your devices are subscribed to. These are akin to channels in the DDN with less of an epehemeral nature. Note that currently, you can only send to _one_ interest.
@@ -279,17 +266,17 @@ Example:
279266
```ruby
280267
data = {
281268
apns: {
282-
alert: {
283-
body: 'tada'
269+
aps: {
270+
alert: {
271+
body: 'tada'
272+
}
284273
}
285274
}
286275
}
287276

288277
pusher.notify(["my-favourite-interest"], data)
289278
```
290279

291-
You may similarly use this method globally too.
292-
293280
### Errors
294281

295282
Push notification requests, once submitted to the service are executed asynchronously. To make reporting errors easier, you can supply a `webhook_url` field in the body of the request. This will be used by the service to send a webhook to the supplied URL if there are errors.
@@ -301,8 +288,10 @@ For example:
301288
```ruby
302289
data = {
303290
apns: {
304-
alert: {
305-
body: "hello"
291+
aps: {
292+
alert: {
293+
body: "hello"
294+
}
306295
}
307296
},
308297
gcm: {

lib/pusher/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def initialize(options = {})
3434

3535
# TODO: Change host name when finalized
3636
merged_options[:notification_host] =
37-
options.fetch(:notification_host, "hedwig-staging.herokuapp.com")
37+
options.fetch(:notification_host, "nativepush-cluster1.pusher.com")
3838

3939
merged_options[:notification_scheme] =
4040
options.fetch(:notification_scheme, "https")

spec/client_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@
538538
end
539539

540540
it "should use the default host if not provided" do
541-
expect(@client.notification_host).to eq("hedwig-staging.herokuapp.com")
541+
expect(@client.notification_host).to eq("nativepush-cluster1.pusher.com")
542542
end
543543

544544
it "should use a newly provided host" do
@@ -632,7 +632,7 @@
632632
end
633633

634634
it "should send a request to the notifications endpoint" do
635-
notification_host_regexp = %r{hedwig-staging.herokuapp.com}
635+
notification_host_regexp = %r{nativepush-cluster1.pusher.com}
636636
payload = {
637637
interests: ["test"],
638638
gcm: {
@@ -657,7 +657,7 @@
657657
end
658658

659659
it "should delete restricted gcm keys before sending a notification" do
660-
notification_host_regexp = %r{hedwig-staging.herokuapp.com}
660+
notification_host_regexp = %r{nativepush-cluster1.pusher.com}
661661
payload = {
662662
interests: ["test"],
663663
gcm: {

0 commit comments

Comments
 (0)