------------------------------ push/service.go -------------------------------
index d1388e1..2ccdaee 100644
@@ -30,6 +30,7 @@ const maxPayload = 4096 // 4KB at most
type Service struct {
Host string
Client *http.Client
Topic string
}
// NewService creates a new service to connect to APN.
@@ -72,6 +73,8 @@ func (s Service) Push(deviceToken string, headers Headers, payload []byte) (st
return "", err
}
req.Header.Set("Content-Type", "application/json")
------------------------------ push/service.go ------------------------------- index d1388e1..2ccdaee 100644 @@ -30,6 +30,7 @@ const maxPayload = 4096 // 4KB at most type Service struct { Host string Client *http.Client
Topic string }
// NewService creates a new service to connect to APN. @@ -72,6 +73,8 @@ func (s Service) Push(deviceToken string, headers Headers, payload []byte) (st return "", err } req.Header.Set("Content-Type", "application/json")
req.Header.Set("apns-topic", s.Topic) headers.set(req.Header)
resp, err := s.Client.Do(req)