I have searched over the Stackoverflow, but none of them answer to my questions
Build from Xcode APNS works, but App Store version my backend raises BadDeviceToken
.
The Success
are registration_id
made by build from source
In [1]: APNSDevice.objects.all().send_message("test")
Out[1]:
[{'27321a3d872613499e27638733e9d1da7e6aa52888a2d90769b150f6339360b1': 'Success',
'798a23a46169e405c41a0c9f44faa0acd39a65119960b973acd248a6de1d624e': 'Success',
'1d742a9ae1684fed5e6c672587ee27c1523cc97e931cc64f108f7c4924aba2af': 'DeviceTokenNotForTopic',
'27173de1aed3a065644708602fd5659cf4e0f8c3ce5b3ef7c4b0769655b92041': 'DeviceTokenNotForTopic',
'e5647247877a0e1db3c7b52821b4230551267ca8a360f862ec5dde506e9b2f36': 'Success',
'0eecae0cb6f4c27ee4b915e37dbb9c7cc84e4967e71c8efab808e231f46b8ec6': 'BadDeviceToken',
'582d6a7c4628131cba9d0dfa9096cc81e3b48f6b6409252515d7402ef1c3ef30': 'BadDeviceToken'}]
I don't care DeviceTokenNotForTopic
for now. Just stay focus on BadDeviceToken
Step to reproduce are:
- Follow this to get
.p12
file - Then make
.pem
from doc. I must putpassphrase
tokey
otherwise I can not proceed next step - Download my own app from App Store and login to get
registration_id
Checkings:
pushtry.com
I upload.p12
and putregistration_id
. It works I can getpush notification
openssl s_client -connect gateway.push.apple.com:2195 -cert aps-cert.pem -key aps-key-noenc.pem
also works without any problem. The connection still remain
My configuration:
Django3
django-push-notification @master commit: c610dd9c7871f4e81bdffce783df8b040ca22878
settings.py
PUSH_NOTIFICATIONS_SETTINGS['APNS_CERTIFICATE'] = str(APPS_DIR) + '/push_noti/dd/aps.pem'
PUSH_NOTIFICATIONS_SETTINGS['APNS_USE_SANDBOX'] = "gateway.push.apple.com:2195"
PUSH_NOTIFICATIONS_SETTINGS['APNS_TOPIC'] = "com.multy.herr.reviews"
I had tried with the same production
APNS cert according to this
Development server: api.sandbox.push.apple.com:443
Production server: api.push.apple.com:443
However, all giving me same BadDevieToken
FYI:
I am using production
APNS cert
I take care only Django backend. My iOS developer upload app from his computer. I am not sure this will be problematic or not
I had tried fastlane
with pushtry.com
again .p12
works, but .pem
does not. It pop up dialog production_com.xxx.yyy.zzz.pem | 3883 | application/x-x509-ca-cert
Question:
Where am I wrong?
Another Solution:
I might use AWS SNS to deal with this