Commit Graph
36 Commits
Author SHA1 Message Date
afonin 5c36c66237 - fix issue with returned reason 2022-04-20 09:56:46 +03:00
afonin 5129ffb903 - fix issue with returned reason 2022-04-20 09:51:36 +03:00
afonin 28ac695a78 - fix issue with returned reason 2022-04-20 09:31:16 +03:00
afonin 34fd0d0264 Update 'apns2/client.py'
- fix backward compatibility
2022-04-17 10:29:38 +03:00
Ankit Desai f1220b8e0b remove hyper from apns2 2020-06-23 18:38:47 -04:00
Sergey Petrov e60ca8c4e9 Update sandbox endpoint
Fixes #93
2020-04-19 19:56:59 +03:00
Anders Kaseorg a3c5b48cef Rephrase problematic Optional[Type[JSONEncoder]] (for Python < 3.5.3)
On Ubuntu 16.04, which has Python 3.5.2, this raised `TypeError:
descriptor '__subclasses__' of 'type' object needs an
argument` (https://github.com/python/typing/issues/266).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-08 22:49:46 +03:00
Anders Kaseorg 88ee900854 Don’t import typing.Deque at runtime (for Python < 3.5.4)
On Ubuntu 16.04, which has Python 3.5.2, `apns2.client` failed to
import, because `typing.Deque` was not added until Python 3.5.4.

Fixes #88.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-08 22:49:46 +03:00
Sergey Petrov 56d8bf2a88 Infer push notification type from topic
Close #87
2019-10-03 00:45:49 +03:00
meteran 3e9a191f4b Adding apns-push-type header 2019-08-07 19:26:43 +03:00
Sergey Petrov fde28abb04 Add type annotations (PEP 484) (#25) 2019-07-29 01:26:15 +03:00
aaronjheng ad899c22ab Use new sandbox address 2018-09-23 13:15:19 +03:00
arthur-a 1f9f7a9dbc Add heartbeat option to keep connection alive (#63) 2018-07-09 14:20:47 +03:00
Sergey Petrov ccfaf75398 Add timestamp field for Unregistered exception
Fix #61
2018-05-07 19:28:06 +03:00
Pavel Valach d3d75d1073 client.connect(): after error, close the connection
Otherwise, the next self._connection.connect() call will not try again. In fact, it will do nothing. It won't raise the exception again.

Therefore, closing the connection before retrying is mandatory.
2017-12-18 13:34:39 +03:00
Jordi Sesmero a3244df06d add proxy support to connection (#46) 2017-11-28 13:23:55 +03:00
Sergey Petrov 653b37054d Improve code quality 2017-05-23 00:45:08 +03:00
Sergey Petrov e10319b78d Make topic parameter optional again 2017-05-14 02:11:43 +03:00
Peter Justin 7783520dc3 load certificate with password
Readded because the last commit removed this.
2017-05-09 15:22:08 +03:00
Masa ae835a195f Enable JWT authentication in addition to old certificate authentication (#40) 2017-05-03 23:15:26 +03:00
Roman Gorbil 164d146940 Add parameter collapse_id
This is APNS header `apns-collapse-id` used to group
notifications. Read more here:
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW13
2017-05-02 22:06:11 +03:00
Jerome Leclanche 7aff9f0321 Make server and port easier to override in subclasses
- Change __connection to _connection
- Move connection initialization to a separate _init_connection method
- Pick the default host and port values from class attributes

Refs #33
2017-03-22 11:13:09 +03:00
erhuabushuo 4f0f73fd7d load_cert_chain support to pass password parameter (#35)
* support pass password paramter to load cert file

* load_cert_chain support to pass password parameter
2017-03-20 12:14:05 +03:00
Matan Gover 701b587c32 Support sending notifications in batch. (#27) 2017-01-23 20:10:35 +03:00
Sergey Petrov b917868b15 Adjust settings for linters (#23) 2017-01-08 13:07:22 +03:00
Lazarev Ivan 92a04546f9 Fix memory leak of Stream objects in HTTP20Connection 2016-12-25 01:34:45 +03:00
Hanno Zulla 760cec6851 Allow using custom JSON conversion class. (#15) 2016-10-20 20:02:02 +03:00
John Loehrer cdc0a3dc49 support for apns-expiration header https://developer.apple.com/library/tvos/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html 2016-06-20 09:35:25 -07:00
firkeuf 1c16d81e46 Update client.py
should add force_proto else get proto = None and crash

hyper/http20/connection.py", line 354
assert proto in H2_NPN_PROTOCOLS or proto == H2C_PROTOCOL
2016-05-13 14:08:55 +03:00
firkeuf 50c5920592 Update client.py
hyper > common > util > to_bytestring
can not convert INT to byte
and raise ValueError("Non string type.")
2016-05-13 12:02:10 +03:00
leovp 4fb9a5ec8f Use proper and more clear parameter name in APNsClient 2016-03-26 12:51:49 +03:00
Leonid R 413957fa59 Update client.py according to PEP8 2016-03-25 23:33:26 +04:00
Leonid R 09685404ea Fixed spelling in client.py 2016-03-25 23:30:01 +04:00
Sergey Petrov 515bf64ae4 Add priority option for sending notification 2016-02-09 16:51:42 +03:00
Sergey Petrov 3f61fac159 Add error handling for sending notifications 2016-02-09 16:45:43 +03:00
Sergey Petrov 29f818cf43 Add initial implementation for sending notifications 2016-02-01 13:02:19 +03:00