Search code examples
djangodjango-adminapple-push-notificationsdjango-push-notifications

django push notification showing error in deployment


settings.py:

PUSH_NOTIFICATIONS_SETTINGS = {

    "APNS_CERTIFICATE": os.path.join(BASE_DIR, 'app.pem'),
    "APNS_TOPIC": "app.Tamakoshi",
    "APNS_USE_SANDBOX":True,

}

from the admin panel i created a APNSDevice and entered the Registration ID as well with isActive checked. When I try to send the push notification selecting the device and clicking on 'Send test message', the error I get is Some messages could not be processed: 'DeviceTokenNotForTopic'


Solution

  • I've seen this error before and found the answer here!:

    In short, you need to ensure that the Apple App ID of the provisioning profile with which the application is deployed to a device is matching the Apple App ID for which the server push SSL certificate is configured.

    For example, you have deployed the app with the provisioning profile for com.mycompany.mypushapp but on the server you have uploaded a push certificate for com.mycompany.myusuallapp.