Use proper and more clear parameter name in APNsClient
This commit is contained in:
@@ -15,7 +15,7 @@ from apns2.payload import Payload
|
|||||||
|
|
||||||
token_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87'
|
token_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87'
|
||||||
payload = Payload(alert="Hello World!", sound="default", badge=1)
|
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)
|
client.send_notification(token_hex, payload)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -14,9 +14,9 @@ class NotificationPriority(Enum):
|
|||||||
|
|
||||||
|
|
||||||
class APNsClient(object):
|
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'
|
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 = init_context()
|
||||||
ssl_context.load_cert_chain(cert_file)
|
ssl_context.load_cert_chain(cert_file)
|
||||||
self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context)
|
self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context)
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class APNsClient(object):
|
|||||||
def __init__(self,
|
def __init__(self,
|
||||||
cert_file: str,
|
cert_file: str,
|
||||||
use_sandbox: bool = False,
|
use_sandbox: bool = False,
|
||||||
use_alternate_port: bool = False) -> None: ...
|
use_alternative_port: bool = False) -> None: ...
|
||||||
|
|
||||||
def send_notification(self,
|
def send_notification(self,
|
||||||
token_hex: str,
|
token_hex: str,
|
||||||
|
|||||||
Reference in New Issue
Block a user