mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2025-01-09 17:33:47 +00:00
add alive option
This commit is contained in:
parent
56e0c6098c
commit
61e6b08b66
1 changed files with 6 additions and 11 deletions
17
demo.py
17
demo.py
|
@ -138,18 +138,12 @@ async def main(args: argparse.Namespace):
|
|||
print("Re-registering...")
|
||||
users = register(conn, users)
|
||||
|
||||
print(f"Done?")
|
||||
|
||||
# You CANNOT turn around and re-register like this:
|
||||
# It will BREAK the tie between phone number and Apple ID
|
||||
|
||||
# import emulated.nac
|
||||
|
||||
# vd = emulated.nac.generate_validation_data()
|
||||
# vd = b64encode(vd).decode()
|
||||
|
||||
# users = ids.register(conn, [users[1]], vd)
|
||||
|
||||
print(f"Done? {users}")
|
||||
if args.alive:
|
||||
logging.getLogger("apns").setLevel(logging.DEBUG)
|
||||
while True:
|
||||
await trio.sleep(20)
|
||||
|
||||
|
||||
|
||||
|
@ -270,6 +264,7 @@ async def output_task(im: imessage.iMessageUser):
|
|||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--reregister", action="store_true", help="Force re-registration")
|
||||
parser.add_argument("--alive", action="store_true", help="Keep the connection alive")
|
||||
parser.add_argument("--client-data", action="store_true", help="Publish client data (only necessary for actually sending/receiving messages)")
|
||||
args = parser.parse_args()
|
||||
trio.run(main, args)
|
Loading…
Reference in a new issue