mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-23 11:22:42 -06:00
minor change
This commit is contained in:
parent
b128ac514a
commit
8148504722
1 changed files with 4 additions and 6 deletions
10
ids.py
10
ids.py
|
@ -91,8 +91,6 @@ def _send_request(conn: apns.APNSConnection, type: str, body: bytes) -> bytes:
|
||||||
# Sign the request
|
# Sign the request
|
||||||
signature, nonce = sign_payload(global_key, type, "", PUSH_TOKEN, body)
|
signature, nonce = sign_payload(global_key, type, "", PUSH_TOKEN, body)
|
||||||
|
|
||||||
print(signature)
|
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"x-id-cert": global_cert.replace("-----BEGIN CERTIFICATE-----", "")
|
"x-id-cert": global_cert.replace("-----BEGIN CERTIFICATE-----", "")
|
||||||
.replace("-----END CERTIFICATE-----", "")
|
.replace("-----END CERTIFICATE-----", "")
|
||||||
|
@ -119,12 +117,12 @@ def _send_request(conn: apns.APNSConnection, type: str, body: bytes) -> bytes:
|
||||||
conn.send_message("com.apple.madrid", plistlib.dumps(req, fmt=plistlib.FMT_BINARY))
|
conn.send_message("com.apple.madrid", plistlib.dumps(req, fmt=plistlib.FMT_BINARY))
|
||||||
resp = conn.wait_for_packet(0x0A)
|
resp = conn.wait_for_packet(0x0A)
|
||||||
|
|
||||||
resp2 = apns._get_field(resp[1], 3)
|
resp_body = apns._get_field(resp[1], 3)
|
||||||
|
|
||||||
if resp2 is None:
|
if resp_body is None:
|
||||||
print(f"Got invalid response: {resp}")
|
raise (Exception(f"Got invalid response: {resp}"))
|
||||||
|
|
||||||
return resp2
|
return resp_body
|
||||||
|
|
||||||
|
|
||||||
def lookup(conn: apns.APNSConnection, query: list[str]) -> any:
|
def lookup(conn: apns.APNSConnection, query: list[str]) -> any:
|
||||||
|
|
Loading…
Reference in a new issue