mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-23 19:32:29 -06:00
send ACKs so it shows as Delivered
This commit is contained in:
parent
9be46ffcab
commit
baf922af61
2 changed files with 6 additions and 4 deletions
8
apns.py
8
apns.py
|
@ -238,10 +238,10 @@ class APNSConnection:
|
||||||
logger.debug("Sending keep alive message")
|
logger.debug("Sending keep alive message")
|
||||||
self.sock.write(_serialize_payload(0x0C, []))
|
self.sock.write(_serialize_payload(0x0C, []))
|
||||||
|
|
||||||
# def _send_ack(self, id: bytes):
|
def _send_ack(self, id: bytes):
|
||||||
# print(f"Sending ACK for message {id}")
|
logger.debug(f"Sending ACK for message {id}")
|
||||||
# payload = _serialize_payload(0x0B, [(1, self.token), (4, id), (8, b"\x00")])
|
payload = _serialize_payload(0x0B, [(1, self.token), (4, id), (8, b"\x00")])
|
||||||
# self.sock.write(payload)
|
self.sock.write(payload)
|
||||||
# #self.sock.write(_serialize_payload(0x0B, [(4, id)])
|
# #self.sock.write(_serialize_payload(0x0B, [(4, id)])
|
||||||
# #pass
|
# #pass
|
||||||
|
|
||||||
|
|
2
demo.py
2
demo.py
|
@ -233,6 +233,8 @@ while True:
|
||||||
return True
|
return True
|
||||||
payload = conn.incoming_queue.wait_pop_find(check_response)
|
payload = conn.incoming_queue.wait_pop_find(check_response)
|
||||||
resp_body = apns._get_field(payload[1], 3)
|
resp_body = apns._get_field(payload[1], 3)
|
||||||
|
id = apns._get_field(payload[1], 4)
|
||||||
|
conn._send_ack(id)
|
||||||
resp_body = plistlib.loads(resp_body)
|
resp_body = plistlib.loads(resp_body)
|
||||||
#logging.info(f"Got response: {resp_body}")
|
#logging.info(f"Got response: {resp_body}")
|
||||||
payload = resp_body["P"]
|
payload = resp_body["P"]
|
||||||
|
|
Loading…
Reference in a new issue