Exemplo n.º 1
0
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])
Exemplo n.º 2
0
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])