Overview
This article will provide a solution and additional information about the “Guardian - There was an error sending the push notification: Invalid sandbox
value and/or APNs certificate was provided” error.
Applies To
- Guardian SDK
- APN
- Notifications
Cause
Customers can test with their own internal environment for sending push notifications via production via official Apple documentation in order to determine if the issue lies with Auth0 or their own configuration.
This push behavior is specifically related to Apple’s push notification system. When calling push notifications, Apple provides different endpoints for sandbox and production. What can be confirmed for certain is that a “correct” configuration of the certificate used for push notification for production results in the push notification being delivered; however, the configuration in question depends on how the customer sets up their iOS environment. This is handled by Apple as seen here: Sending notification requests to APNs | Apple
It is not just the host being used that matters here, but which device or app is involved in using the push notification. A device or app that is configured with the sandbox certificate or token may not work in production and vice versa - hence the meaning of “correct” configuration. When a custom app is registered to receive push notifications, there is a separate certificate registration process - as seen here: Registering your app with APNs | Apple. It should be possible for the customer to test push notifications without involving Auth0 at all first to confirm if the certificate configuration is working or not, given the production option.
Solution
Regenerate the APN certificate and upload it again. This, in addition to testing what is discussed in the “Cause” section, should resolve the issue.