def send_push_notification(self): devices = self.user['devices'].values() topic = '45d4a8f8d83fdc7ba96233018fe1aa475fbccd6e'.decode('hex') payload = '{"r":"%s"}' % str(self.apple_id) log.msg('send_push_notification: Sending push notifications to ' 'tokens: %s' % repr(devices)) for device in devices: device = device.decode('hex') PushService.send_notification(device, topic, payload)