Closed coder-han closed 8 years ago
Send ok. feedback error:Could not create feedback crypto/tls: failed to parse certificate PEM data
client, err := apns.NewClientWithFiles(apns.ProductionGateway, "resource/cer.pem", "resource/key.unencrypted.pem") if nil != err { util.NewLog().Info(err.Error()) } //设置样式 payload := apns.NewPayload() payload.APS.Alert.Body = "hello,world2222" payload.APS.Sound = "bingbong.aiff" m := apns.NewNotification() m.Payload = payload m.DeviceToken = "00d7c5d3d764b4eef67096f562748c2ee11939bddffed866f453ca745249fdaa" client.Send(m) f, err := apns.NewFeedback(apns.ProductionFeedbackGateway,"resource/cer.pem", "resource/key.unencrypted.pem") if err != nil { fmt.Println("Could not create feedback", err.Error()) } for ft := range f.Receive() { fmt.Println("Feedback for token:", ft.DeviceToken) }
I use the wrong way?
I think you want apns.NewFeedbackWithFiles.
apns.NewFeedbackWithFiles
thank you. 666666
Send ok. feedback error:Could not create feedback crypto/tls: failed to parse certificate PEM data
code