https://github.com/djacobs/PyAPNs

Problem 1. Push notification Failed right after sending invalid token

APNS uses socket to send notification object. and if it use invalid token, that connection will be disconnected. you can overcome this by re-generating APNs Object.

But there is one more problem. If you use for loop with same APNs Object, and there is an invalid token, the tokens right after sending invalid token will be failed. 

So, there is an option named enhanced=True, it will check each tokens if it succeeded. and It uses non-blocking ssl socket, and check error using another thread. So I think there is no critical waiting. In the function "_resend_notification_by_range" It sends only notifications after invalid token.

They also provide "send_notification_multiple" function. This function doesn't check error and discard all tokens after invalid token.


Issue 1. FeedbackConnection

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW3

- connection method and how many tokens you can receive?

they use socket. and It reads data using streaming until there is no data. see below


Once you are connected, transmission begins immediately; you do not need to send any command to APNs. Read the stream from the feedback service until there is no more data to read.

... 

The feedback service’s list is cleared after you read it. Each time you connect to the feedback service, the information it returns lists only the failures that have happened since you last connected.


'분류없음' 카테고리의 다른 글

[cpp] std::move는 단지 캐스팅일 뿐이라고?  (0) 2017.02.08
Same string but different length  (0) 2016.10.28
JIT vs Interpreter  (0) 2016.10.25
git pushed merge cancel  (0) 2015.04.13
[encoding] javascript write to csv  (0) 2015.04.11
블로그 이미지

시간을 거스르는자

ytkang86@gmail.com

,