jazzband / django-push-notifications

Send push notifications to mobile devices through GCM or APNS in Django.
MIT License
2.26k stars 613 forks source link

Sending APNS notification to devices without application ID #553

Closed captain-fox closed 4 years ago

captain-fox commented 4 years ago

I'm looking for a library to send APNS notifications to passes in Wallet app on iOS devices. This means I don't need/have application ID, but only use push token and Pass Type ID instead. After I've looked into implementation of this package there's mandatory application_id parameter all over the place. Is there any way to use this library bypassing (without) application_id?

elcolie commented 4 years ago

I confirm. I am using my configuration without application_id. It is legacy and fading out now you can check from master Here are my config

base.py

PUSH_NOTIFICATIONS_SETTINGS = {
        "FCM_API_KEY": "AAAAQRdHxu...............xxxxxxxxx",
        "APNS_CERTIFICATE": str(APPS_DIR) + '/push_noti/my_cert.pem',
        "APNS_USE_SANDBOX": "api.sandbox.push.apple.com:443",
        "WP_PRIVATE_KEY": str(APPS_DIR) + "/push_noti/private_key.pem",
        "WP_CLAIMS": {'sub': "mailto: sarit@elcolie.com"},
        "UPDATE_ON_DUPLICATE_REG_ID": True,
}

production.py

PUSH_NOTIFICATIONS_SETTINGS['APNS_CERTIFICATE'] = str(APPS_DIR) + '/push_noti/ff/production_com.xxx.yyy.zzz.pem'
PUSH_NOTIFICATIONS_SETTINGS['APNS_USE_SANDBOX'] = False
PUSH_NOTIFICATIONS_SETTINGS['APNS_TOPIC'] = "com.xxx.yyy.zzz"