From b6a0ecefa09d937b21ee3ca691ec73406b809d02 Mon Sep 17 00:00:00 2001 From: Asif Date: Mon, 13 May 2019 17:10:23 +0530 Subject: [PATCH 1/2] Update development APNS host The development APNS host url was outdated. The new URL is `https://api.sandbox.push.apple.com` From: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns This should help fix issue #24, where the client used to timeout because of an invalid host url --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 221a7df6..bd062597 100644 --- a/client.go +++ b/client.go @@ -19,7 +19,7 @@ import ( // Apple HTTP/2 Development & Production urls const ( - HostDevelopment = "https://api.development.push.apple.com" + HostDevelopment = "https://api.sandbox.push.apple.com" HostProduction = "https://api.push.apple.com" ) From 02508a2976cffba6118ab881e7ad4860b63e390d Mon Sep 17 00:00:00 2001 From: Adam Jones Date: Sun, 8 Sep 2019 10:15:09 +1200 Subject: [PATCH 2/2] Fix dev enpoint tests --- client_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client_test.go b/client_test.go index c32be0d0..5eda4a69 100644 --- a/client_test.go +++ b/client_test.go @@ -58,22 +58,22 @@ func (c *mockTransport) CloseIdleConnections() { func TestClientDefaultHost(t *testing.T) { client := apns.NewClient(mockCert()) - assert.Equal(t, "https://api.development.push.apple.com", client.Host) + assert.Equal(t, "https://api.sandbox.push.apple.com", client.Host) } func TestTokenDefaultHost(t *testing.T) { client := apns.NewTokenClient(mockToken()).Development() - assert.Equal(t, "https://api.development.push.apple.com", client.Host) + assert.Equal(t, "https://api.sandbox.push.apple.com", client.Host) } func TestClientDevelopmentHost(t *testing.T) { client := apns.NewClient(mockCert()).Development() - assert.Equal(t, "https://api.development.push.apple.com", client.Host) + assert.Equal(t, "https://api.sandbox.push.apple.com", client.Host) } func TestTokenClientDevelopmentHost(t *testing.T) { client := apns.NewTokenClient(mockToken()).Development() - assert.Equal(t, "https://api.development.push.apple.com", client.Host) + assert.Equal(t, "https://api.sandbox.push.apple.com", client.Host) } func TestClientProductionHost(t *testing.T) {