def apns_fetch_inactive_ids(certfile=None):
 with closing(_apns_create_socket_to_feedback(certfile)) as socket:
  inactive_ids = []
  for (ts, registration_id) in _apns_receive_feedback(socket):
   inactive_ids.append(codecs.encode(registration_id, 'hex_codec'))
  return inactive_ids

def apns_fetch_inactive_ids ( certfile = None ) : with closing ( _apns_create_socket_to_feedback ( certfile ) ) as socket : inactive_ids = [ ] for ( ts , registration_id ) in _apns_receive_feedback ( socket ) : inactive_ids . append ( codecs . encode ( registration_id , 'hex_codec' ) ) return inactive_ids
queries the apns server for ids that are no longer active since the last fetch .