From 4fb9a5ec8f95f26abb09a7c8979b76853450544f Mon Sep 17 00:00:00 2001 From: leovp Date: Sat, 26 Mar 2016 12:51:49 +0300 Subject: [PATCH] Use proper and more clear parameter name in APNsClient --- README.md | 2 +- apns2/client.py | 4 ++-- apns2/client.pyi | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 34f9257..844a5d4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ from apns2.payload import Payload token_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87' payload = Payload(alert="Hello World!", sound="default", badge=1) -client = APNsClient('key.pem', use_sandbox=False, use_alternate_port=False) +client = APNsClient('key.pem', use_sandbox=False, use_alternative_port=False) client.send_notification(token_hex, payload) ``` diff --git a/apns2/client.py b/apns2/client.py index 7a869e5..2fa9b6c 100644 --- a/apns2/client.py +++ b/apns2/client.py @@ -14,9 +14,9 @@ class NotificationPriority(Enum): class APNsClient(object): - def __init__(self, cert_file, use_sandbox=False, use_alternate_port=False): + def __init__(self, cert_file, use_sandbox=False, use_alternative_port=False): server = 'api.development.push.apple.com' if use_sandbox else 'api.push.apple.com' - port = 2197 if use_alternate_port else 443 + port = 2197 if use_alternative_port else 443 ssl_context = init_context() ssl_context.load_cert_chain(cert_file) self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context) diff --git a/apns2/client.pyi b/apns2/client.pyi index d4d47c1..f6b3bcd 100644 --- a/apns2/client.pyi +++ b/apns2/client.pyi @@ -8,7 +8,7 @@ class APNsClient(object): def __init__(self, cert_file: str, use_sandbox: bool = False, - use_alternate_port: bool = False) -> None: ... + use_alternative_port: bool = False) -> None: ... def send_notification(self, token_hex: str,