mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-24 03:42:43 -06:00
fix bug when restoring using existing push token
This commit is contained in:
parent
d66e3e0adf
commit
1bd21cbbb7
1 changed files with 7 additions and 1 deletions
8
apns.py
8
apns.py
|
@ -101,7 +101,13 @@ class APNSConnection:
|
||||||
):
|
):
|
||||||
raise Exception("Failed to connect")
|
raise Exception("Failed to connect")
|
||||||
|
|
||||||
self.token = _get_field(payload[1], 3)
|
new_token = _get_field(payload[1], 3)
|
||||||
|
if new_token is not None:
|
||||||
|
self.token = new_token
|
||||||
|
elif token is not None:
|
||||||
|
self.token = token
|
||||||
|
else:
|
||||||
|
raise Exception("No token")
|
||||||
|
|
||||||
return self.token
|
return self.token
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue