Skip to content

Commit d5782b2

Browse files
author
Anya Zenkina
committed
remove native push notifications
1 parent a6d255d commit d5782b2

File tree

4 files changed

+0
-152
lines changed

4 files changed

+0
-152
lines changed

lib/pusher.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ def default_client
6666
require 'pusher/request'
6767
require 'pusher/resource'
6868
require 'pusher/webhook'
69-
require 'pusher/native_notification/client'

lib/pusher/client.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -317,24 +317,6 @@ def trigger_batch_async(*events)
317317
post_async('/batch_events', trigger_batch_params(events.flatten))
318318
end
319319

320-
def notification_client
321-
@notification_client ||=
322-
NativeNotification::Client.new(@app_id, @notification_host, @notification_scheme, self)
323-
end
324-
325-
326-
# Send a push notification
327-
#
328-
# POST /apps/[app_id]/notifications
329-
#
330-
# @param interests [Array] An array of interests
331-
# @param message [String] Message to send
332-
# @param options [Hash] Additional platform specific options
333-
#
334-
# @return [Hash]
335-
def notify(interests, data = {})
336-
notification_client.notify(interests, data)
337-
end
338320

339321
# Generate the expected response for an authentication endpoint.
340322
# See http://pusher.com/docs/authenticating_users for details.

lib/pusher/native_notification/client.rb

Lines changed: 0 additions & 69 deletions
This file was deleted.

spec/client_spec.rb

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -579,70 +579,6 @@
579579
end
580580
end
581581
end
582-
583-
describe "native notifications" do
584-
before :each do
585-
@client.app_id = "20"
586-
@client.key = "testytest"
587-
@client.secret = "mysupersecretkey"
588-
end
589-
590-
it "should configure a native notification client using the pusher client object" do
591-
expect(@client.notification_client).to_not be(nil)
592-
end
593-
594-
it "should use the default host if not provided" do
595-
expect(@client.notification_host).to eq("nativepush-cluster1.pusher.com")
596-
end
597-
598-
it "should use a newly provided host" do
599-
@client.notification_host = "test.com"
600-
expect(@client.notification_host).to eq("test.com")
601-
end
602-
603-
it "should set the native notification client host to the same one" do
604-
expect(@client.notification_host).to eq(@client.notification_client.host)
605-
end
606-
607-
it "should raise an error if no interest is provided" do
608-
payload = {
609-
gcm: {
610-
notification: {
611-
title: "Hello",
612-
icon: "icon",
613-
}
614-
}
615-
}
616-
617-
expect { @client.notify([], payload) }.to raise_error(Pusher::Error)
618-
end
619-
620-
it "should send a request to the notifications endpoint" do
621-
notification_host_regexp = %r{nativepush-cluster1.pusher.com}
622-
payload = {
623-
interests: ["test"],
624-
gcm: {
625-
notification: {
626-
title: "Hello",
627-
icon: "icon",
628-
}
629-
}
630-
}
631-
632-
stub_request(
633-
:post,
634-
notification_host_regexp,
635-
).with(
636-
body: MultiJson.encode(payload)
637-
).to_return({
638-
:status => 200,
639-
:body => MultiJson.encode({ :foo => "bar" })
640-
})
641-
642-
res = @client.notify(["test"], payload)
643-
expect(res).to eq({foo: "bar"})
644-
end
645-
end
646582
end
647583

648584
describe 'configuring cluster' do

0 commit comments

Comments
 (0)