Skip to content

Commit f8e8197

Browse files
committed
return something in notify/provision (not None--xmlrpclib doesn't like this and twisted doesn't seem to want to do anything about it)
1 parent 9739f73 commit f8e8197

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pyapns/server.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,12 @@ def cancel_timeout(r):
241241

242242
class APNSServer(xmlrpc.XMLRPC):
243243
def __init__(self):
244-
self.allowNone = True
244+
# self.allowNone = True
245+
# self.allow_none = True
245246
self.app_ids = app_ids
247+
self.use_date_time = True
246248
self.useDateTime = True
247-
xmlrpc.XMLRPC.__init__(self)
249+
xmlrpc.XMLRPC.__init__(self, allow_none=True)
248250

249251
def apns_service(self, app_id):
250252
if app_id not in app_ids:
@@ -270,7 +272,9 @@ def xmlrpc_provision(self, app_id, path_to_cert_or_cert, environment, timeout=15
270272
'environments are `sandbox` and `production`' % (
271273
environment,))
272274
if not app_id in self.app_ids:
275+
# log.msg('provisioning ' + app_id + ' environment ' + environment)
273276
self.app_ids[app_id] = APNSService(path_to_cert_or_cert, environment, timeout)
277+
return 'provisioned'
274278

275279
def xmlrpc_notify(self, app_id, token_or_token_list, aps_dict_or_list):
276280
""" Sends push notifications to the Apple APNS server. Multiple
@@ -297,7 +301,7 @@ def _finish_err(r):
297301
# that are made unsuccessfully, which twisted will try endlessly
298302
# to reconnect to, we timeout and notifify the client
299303
raise xmlrpc.Fault(500, 'Connection to the APNS server could not be made.')
300-
return d.addCallbacks(lambda r: None, _finish_err)
304+
return d.addCallbacks(lambda r: 'sent', _finish_err)
301305

302306
def xmlrpc_feedback(self, app_id):
303307
""" Queries the Apple APNS feedback server for inactive app tokens. Returns

0 commit comments

Comments
 (0)