https://github.com/samuraisam/pyapns/を使用して、iPhone アプリケーションに通知を送信しようとしています。
通知を手動で送信するテストを行い、正常に送信できることを確認しました。私たちは堅牢なソリューションを探しており、pyapns について素晴らしいことを聞いています。ただし、これは twistd.log に表示されるログ出力であり、通知を受け取ることはありません。
主な違いは次のとおりです。
- pyapnsを使用しています
- 別の証明書を使用しています。具体的には、通知を手動で送信するときに、キーと証明書の両方を提供し、証明書の読み取りを認証するためのパスワードを提供します。pyapns の場合、パスワードを削除した証明書 + キーの組み合わせを作成します。しかし、まだ通知を受け取ることができません。
根本的な原因が何であるかはわかりません。証明書に問題があるのか、それとも通知の送信に失敗したのかはわかりません。
以下は twistd.log のログです。
2012-04-04 01:21:51+0000 [-] Log opened.
2012-04-04 01:21:51+0000 [-] twistd 12.0.0 (/usr/bin/python 2.7.2) starting up.
2012-04-04 01:21:51+0000 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2012-04-04 01:21:51+0000 [-] Site starting on 7077
2012-04-04 01:21:51+0000 [-] Starting factory <twisted.web.server.Site instance at 0x1f2a908>
2012-04-04 01:31:57+0000 [HTTPChannel,0,127.0.0.1] APNSService __init__
2012-04-04 01:31:57+0000 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [04/Apr/2012:01:31:57 +0000] "POST / HTTP/1.1" 200 114 "-" "xmlrpclib.py/1.0.1 (by www.pythonware.com)"
2012-04-04 01:34:32+0000 [HTTPChannel,1,127.0.0.1] APNSService write (connecting)
2012-04-04 01:34:32+0000 [HTTPChannel,1,127.0.0.1] APNSClientContextFactory ssl_cert_file={FROM_STRING}
2012-04-04 01:34:32+0000 [HTTPChannel,1,127.0.0.1] Starting factory <pyapns.server.APNSClientFactory instance at 0x2065b48>
2012-04-04 01:34:32+0000 [HTTPChannel,1,127.0.0.1] APNSClientFactory startedConnecting
2012-04-04 01:34:32+0000 [Uninitialized] APNSProtocol connectionMade
2012-04-04 01:34:32+0000 [Uninitialized] APNSProtocol sendMessage msg=00002079d7b66de69c6f5e78e5eef9d37d5c69b7b6e7adbdeba75ef5af5ce3b737dde7001a7b22617073223a7b22616c657274223a
2248656c6c6f21227d7d
2012-04-04 01:34:32+0000 [Uninitialized] 127.0.0.1 - - [04/Apr/2012:01:34:31 +0000] "POST / HTTP/1.1" 200 114 "-" "xmlrpclib.py/1.0.1 (by www.pythonware.com)"
2012-04-04 01:34:32+0000 [APNSProtocol (TLSMemoryBIOProtocol),client] APNSProtocol connectionLost
2012-04-04 01:34:32+0000 [APNSProtocol (TLSMemoryBIOProtocol),client] APNSClientFactory clientConnectionLost reason=[Failure instance: Traceback (failure with no frames): <clas
s 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
]
2012-04-04 01:34:32+0000 [APNSProtocol (TLSMemoryBIOProtocol),client] <twisted.internet.tcp.Connector instance at 0x2065c68> will retry in 2 seconds
2012-04-04 01:34:32+0000 [APNSProtocol (TLSMemoryBIOProtocol),client] Stopping factory <pyapns.server.APNSClientFactory instance at 0x2065b48>
2012-04-04 01:34:35+0000 [-] Starting factory <pyapns.server.APNSClientFactory instance at 0x2065b48>
2012-04-04 01:34:35+0000 [-] APNSClientFactory startedConnecting
2012-04-04 01:34:35+0000 [Uninitialized] APNSProtocol connectionMade
2012-04-04 01:34:53+0000 [HTTPChannel,2,127.0.0.1] APNSService read (connecting)
2012-04-04 01:34:53+0000 [HTTPChannel,2,127.0.0.1] APNSClientContextFactory ssl_cert_file={FROM_STRING}
2012-04-04 01:34:53+0000 [HTTPChannel,2,127.0.0.1] Starting factory <pyapns.server.APNSFeedbackClientFactory instance at 0x206ccb0>
2012-04-04 01:34:53+0000 [HTTPChannel,2,127.0.0.1] APNSFeedbackClientFactory startedConnecting
2012-04-04 01:34:53+0000 [Uninitialized] feedbackHandler connectionMade
2012-04-04 01:34:53+0000 [APNSFeedbackHandler (TLSMemoryBIOProtocol),client] feedbackHandler connectionLost [Failure instance: Traceback (failure with no frames): <class 'twist
ed.internet.error.ConnectionDone'>: Connection was closed cleanly.
]
2012-04-04 01:34:53+0000 [APNSFeedbackHandler (TLSMemoryBIOProtocol),client] 127.0.0.1 - - [04/Apr/2012:01:34:53 +0000] "POST / HTTP/1.1" 200 138 "-" "xmlrpclib.py/1.0.1 (by ww
w.pythonware.com)"
2012-04-04 01:34:53+0000 [APNSFeedbackHandler (TLSMemoryBIOProtocol),client] APNSFeedbackClientFactory clientConnectionLost reason=[Failure instance: Traceback (failure with no
frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
]
2012-04-04 01:34:53+0000 [APNSFeedbackHandler (TLSMemoryBIOProtocol),client] Stopping factory <pyapns.server.APNSFeedbackClientFactory instance at 0x206ccb0>