django-push-notifications
django-push-notifications copied to clipboard
APNSServerError DeviceTokenNotForTopic when upgrading
I recently upgraded django-push-notifications from 1.4.1 to 1.5.0, and added the new required APNS_TOPIC
setting set to the bundle id. Everything is working fine for APNS devices created after the upgrade, but for devices created on 1.4.1, when attempting to send push notificiations to them, I am getting APNSServerError DeviceTokenNotForTopic
.
Is there an upgrade path for those devices so I don't lose the ability to send pushes to them? Maybe some way to specify not to send a topic?
Hello ! This was a mistake on our part, I made APNS_TOPIC optional again in https://github.com/jleclanche/django-push-notifications/pull/413 - this will let you not specify a topic again. I will let you know as soon as it's merged.
Hello! Can you please upgrade to master and try sending messages without APNS_TOPIC settings? It should work again, I just merged the APNS_TOPIC not mandatory anymore PR
@kit-cat 2 years by now. Any answer on this problem?
Found the answer
My settings.py
is using production certificate, but for now I need to enable DEBUG=True
. The main problem comes from APNS_TOPIC
is not the same as in the Apple website
DEBUG=True
PUSH_NOTIFICATIONS_SETTINGS['USE_SANDBOX'] = False
PUSH_NOTIFICATIONS_SETTINGS['APNS_USER_SANDBOX'] = 'api.push.apple.com'
PUSH_NOTIFICATIONS_SETTINGS['APNS_CERTIFICATE'] = str(APPS_DIR) + '/push_noti/prod-cert.pem'
PUSH_NOTIFICATIONS_SETTINGS['APNS_TOPIC'] = "com.mycompany.xxx"
Hi @elcolie, I haven't worked on this repo for years - can you please try pinging an active maintainer? Thanks!
@odinuge @wtayyeb Without DEBUG=True
I can not send out push notification
DEBUG=False
will raises Stream
problem.
One big problem right now is django-push-notification
always let sentry
sends out the crash report.
Reference issue
Digging in settings.py found that settings.py#L25 APNS_USE_SANDBOX
is same as DEBUG
if not explicitly set. you must add APNS_USE_SANDBOX=False
to PUSH_NOTIFICATIONS_SETTINGS in your settings.py file to solve the problem.
PS:
- I'm not a maintainer, and just have 2 PR merged!
- GitHub is limiting my account because I`m in Iran. What they think about me?
- there is no settings named
APNS_USER_SANDBOX
as you mentioned in your comment andAPNS_USE_SANDBOX
is used as boolean
@elcolie I don't plan to send APN messages yet, but in case of sentry I have it enabled for development and production deploys beside django-push-notification and don't have your problem.
I am confused
What is the correct value of APNS_USE_SANDBOX
?
Access time Sun Jul 28 12:59:17 +07 2019
After check with source code. Document is outdated