def testAPNSWrapper(encoded_token, cert_path='iphone_cert.pem', sandbox=True): cert_path = 'iphone_cert.pem' """ Method to testing apns-wrapper module. """ wrapper = APNSNotificationWrapper(cert_path, sandbox=sandbox, debug_ssl=True, force_ssl_command=False) badge(wrapper, encoded_token) sound(wrapper, encoded_token) alert(wrapper, encoded_token) wrapper.connect() wrapper.notify() wrapper.disconnect() feedback = APNSFeedbackWrapper(cert_path, sandbox=sandbox, debug_ssl=True, force_ssl_command=False) feedback.receive() print "\n".join(["> " + base64.standard_b64encode(y) for x, y in feedback])
def testAPNSWrapper(encoded_token, cert_path, sandbox=True): """ Method to testing apns-wrapper module. """ wrapper = APNSNotificationWrapper(cert_path, sandbox=sandbox, debug_ssl=True, force_ssl_command=False) badge(wrapper, encoded_token) sound(wrapper, encoded_token) alert(wrapper, encoded_token) wrapper.connect() wrapper.notify() wrapper.disconnect() feedback = APNSFeedbackWrapper(cert_path, sandbox=sandbox, debug_ssl=True, force_ssl_command=False) feedback.receive() print "\n".join(["> " + base64.standard_b64encode(y) for x, y in feedback])