Commit Graph
94 Commits
Author SHA1 Message Date
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 2f02f0f479 version bump -> 0.7.0 0.7.0 2019-10-03 00:48:31 +03:00
Sergey Petrov 56d8bf2a88 Infer push notification type from topic
Close #87
2019-10-03 00:45:49 +03:00
Sergey Petrov b3d9227740 Use Credentials instead of CertificateCredentials in tests 2019-09-12 01:12:20 +03:00
Sergey Petrov 3409ff5bde version bump -> 0.6.0 0.6.0 2019-08-13 02:24:06 +03:00
Sergey Petrov d1a5e995d8 Enable pycodestyle linter 2019-08-11 13:43:19 +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
Sergey Petrov be7438a653 Using pytest from now on 2019-06-02 19:39:40 +03:00
shintonik fbcf36f955 Use only one JWT token per connection (#80)
This fixes #76 where you a TooManyProviderTokenUpdates if you send
notifications to multiple topics over one connection.

As Apple states here https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns#2943374
one connection shall use only one single JWT token which should be
refreshed no more than once every 20 minutes and no less than once every
60 minutes.
2019-05-23 02:01:31 +03:00
Sergey Petrov 95c19c64d7 Remove Python 2.7 because it's not worth supporting at this moment 2019-05-12 21:43:45 +03:00
Sergey Petrov 525734ed35 Remove Python 3.4 from supported because it's no longer supported 2019-05-12 20:02:26 +03:00
M c974873321 Update README.md (#79) 2019-05-12 12:57:23 +03:00
Sergey Petrov 4a81abb6fb version bump -> 0.5.0 0.5.0 2019-05-07 18:42:21 +03:00
Aditya Varma 924ffdbcdb Documentation for batching and tokens authenticate
Update examples for batching support and token based authentication.
2019-05-07 18:28:04 +03:00
Sergey Petrov 2ce920822b Migrate to Drone (#78) 2019-05-07 18:16:42 +03:00
Sergey Petrov 6f3b2a7456 Add Python 3.7 as supported version 2018-11-30 23:33:43 +03:00
Sergey Petrov 26d714117e Do not close pull requests as stale 2018-11-24 00:09:44 +03:00
Sergey Petrov 1268313624 Adjust days until stale 2018-11-23 19:49:31 +03:00
Sergey Petrov 363efa93a4 Add probot-stale configuration 2018-11-23 19:47:53 +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 6159383a81 version bump -> 0.4.1 0.4.1 2018-05-09 16:26:07 +03:00
Sergey Petrov bd31bc3df6 Fix broken Python 2 compatibility 2018-05-09 16:25:38 +03:00
Sergey Petrov b26f2e92e4 version bump -> 0.4.0 0.4.0 2018-05-07 19:29:46 +03:00
Sergey Petrov ccfaf75398 Add timestamp field for Unregistered exception
Fix #61
2018-05-07 19:28:06 +03:00
Pavel Valach d071ec1864 Always use TLS with HTTP20Connection 2017-12-18 13:36:38 +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
SearchDream bbe8528acf Fix _is_expired_token issues (#47) 2017-11-17 15:59:33 +03:00
Sergey Petrov c272fa8bf2 Add support for build stages 2017-05-26 01:12:47 +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
Sergey Petrov e454a79d7f version bump -> 0.3.0 0.3.0 2017-05-09 23:29:02 +03:00
Sergey Petrov d9b3d2c917 Update list of exceptions 2017-05-09 23:27:32 +03:00
Sergey Petrov 3b6e1dcc4c Added capability to pass in cert-key tuple instead of chain certificate file to the APNs client
Close #26
2017-05-09 22:57:34 +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
Sergey Petrov 3d1cf8a144 version bump -> 0.2.1 0.2.1 2017-03-05 14:43:38 +03:00
Camille Fabreguettes de18e2990c Implement thread-id option 2017-03-05 14:41:00 +03:00
Jason Douglas 7fe9d6aa91 README is missing topic argument 2017-03-05 14:27:33 +03:00
Sergey Petrov 3792bc7df8 version bump -> 0.2.0 0.2.0 2017-02-09 00:26:01 +03:00
Sergey Petrov df90e0a7b6 Fix classifiers in setup.py 2017-02-09 00:26:01 +03:00
Sergey Petrov 5e8727132a TravisCI now will automatically deploy to PyPI 2017-02-09 00:18:20 +03:00
Sergey Petrov 48b4acfa76 Remove Python 3.3 from README 2017-01-30 17:09:04 +03:00
Sergey Petrov 9e2fd44a30 Enable CI (#28) 2017-01-25 17:39:04 +03:00