diff --git a/apns2/client.py b/apns2/client.py index 86c4057..3d07968 100644 --- a/apns2/client.py +++ b/apns2/client.py @@ -90,7 +90,7 @@ class APNsClient(object): priority: NotificationPriority = NotificationPriority.Immediate, expiration: Optional[int] = None, collapse_id: Optional[str] = None) -> None: stream_id, reason = self.send_notification_async(token_hex, notification, topic, priority, expiration, collapse_id) - result = self.get_notification_result(stream_id, reason) + result = self.get_notification_result(stream_id, reason.get('reason')) print(123, result) if result != 'Success': if isinstance(result, tuple): @@ -143,7 +143,7 @@ class APNsClient(object): url = '/3/device/{}'.format(token_hex) response = self.__client.post('https://{}{}'.format(self.__server, url), headers=headers, data=json_payload) - return response.status_code, response.text + return response.status_code, response.json() def get_notification_result(self, status: int, reason: str) -> Union[str, Tuple[str, str]]: """