Hello Team,
We are currently experiencing an issue where some of our devices are not receiving push notifications. We are sending notifications via the Apple Push Notification portal (https://developer.apple.com/notifications/push-notifications-console/) using the following two requests. However, in both cases, the notifications are not being delivered to the devices.
Scenario 1 :
When we send a request with apns-push-type set to alert, we receive the following error.
Request :
curl -v
--header "authorization: bearer ${AUTHENTICATION_TOKEN}"
--header "apns-topic: com.testcompany.sampletest"
--header "apns-push-type: alert"
--header "apns-priority: 10"
--header "apns-expiration: 0"
--data '{"aps":{"alert":{"title":"Test Notification Title","subtitle":"Test Notification Sub Title","body":"Test Notification Body"}}}'
--http2 https://api.push.apple.com:443/3/device/devicetoken
Response:
{
"code": 400,
"message": "bad-request",
"reason": "The device token is inactive for the specified topic. There is no need to send further pushes to the same device token, unless your application retrieves the same device token.",
"requestUuid": "c4ae39b4-87e1-4269-a1e9-163f60ec0385"
}
Scenario 2 :
However, if we send the request with apns-push-type set to background, the request is processed successfully by APNs, but no notification is received on the device.
Request :
curl -v
--header "authorization: bearer ${AUTHENTICATION_TOKEN}"
--header "apns-topic: com.testcompany.sampletest"
--header "apns-push-type: background"
--header "apns-priority: 10"
--header "apns-expiration: 0"
--data '{"aps":{"alert":{"title":"Test Notification Title","subtitle":"Test Notification Sub Title","body":"Test Notification Body"}}}'
--http2 https://api.push.apple.com:443/3/device/devicetoken
Response:
Getting a message that The notification sent successfully but no notification is received on the device.
In both cases (with alert and background push types), the push notification does not reach the device.
Additionally, when we validated the device token using the APNs Device Token Validator, it appears to be valid and returns the following message.
"Device Token is valid for sending Alert & Background push-type notifications in the Production environment"
Affected Device:
macOS version : MacOS 15.3.1
Processor : Apple M1
Could you please assist me in resolving this issue?
Thanks