Merge pull request #3 from leovp/master

Use proper and more clear parameter name in APNsClient
This commit is contained in:
Sergey Petrov
2016-03-26 15:40:16 +04:00
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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)
```
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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,