Push not being recieved by devices anymore
See original GitHub issueHi there,
We are using this plugin on Google App Engine with a Cloud Endpoints project.
Several months back when we were testing the integration the push messages were sending.
We have not made any major modifications to our push code and now the messages are not sending.
The App Engine logs show:
GatewayConnection APNS connection establishing...
GatewayConnection APNS connection established
GatewayConnection APNS connection closed
and does not report any 500 errors or SSL/key errors. But the message is not received by the phone.
We are also getting “Deadline Exceeded Errors” at least one of the times we tried.
Our keys are signed correctly using this process:
in keychain access, select both cert and key then export to Certificates.p12 file.
to generate cert.pem openssl pkcs12 -in Certificates.p12 -out cert.pem -nodes -nokeys
to generate key.pem openssl pkcs12 -in Certificates.p12 -out key.pem -nodes -nocerts
Our push code is copied directly from the instructions:
def send_single_push(u, payload):
apns = get_apns_handler(False)
# Send multiple notifications in a single transmission
frame = Frame()
identifier = 1
expiry = time.time()+3600
priority = 10
pa = PushAlias.query(PushAlias.user == u.key).fetch(1)
if pa:
pa = pa[0]
bc = PushBadgeCount.query(PushBadgeCount.alias == pa.key).fetch(1)
if bc:
bc = bc[0]
# Increase the badge count
bc.badge_count += 1
bc.put()
# Set the payload data and badge count
apns_payload = Payload(
alert=payload['alert'],
sound=payload['sound'] if payload.has_key('sound') and payload['sound'] else "default",
badge=bc.badge_count
)
# Add a push to the frame for each device in the alias
for device in pa.devices:
frame.add_item(device, apns_payload, identifier, expiry, priority)
if get_environment() != 'sandbox':
try:
apns.gateway_server.send_notification_multiple(frame)
except:
# Force re-connect
apns.gateway_server._connect()
return False, None
We are mimicking Urban Airship like functionality.
And the keys are set as such:
def get_apns_handler(enhanced=False):
sandbox = True
cert = APNS_CERT_SANDBOX
pem = APNS_PEM_SANDBOX
# if get_environment() == 'prod':
# sandbox = False
# cert = APNS_CERT_PRODUCTION
# pem = APNS_PEM_PRODUCTION
return APNs(use_sandbox=sandbox, cert_file=cert, key_file=pem, enhanced=enhanced)
We are using Googles own SSL library via the app.yaml:
libraries:
- name: ssl
version: latest
Any help would be greatly appreciated. Let me know if you need more information.
Issue Analytics
- State:
- Created 9 years ago
- Comments:9
Resolved by using enhanced=True
I changed enhanced mode to True and the pushes started sending. Can anyone explain why enhanced False and enhanced True would cause this to happen?