Events
How the SDK reports that a notification was opened.
POST /v1/events
Publishable key with the device secret. Reports that the user opened a notification. The SDK calls it for every tap, so you don’t need to. A repeat for the same device and notification is accepted and counted once.
{
"type": "opened",
"deviceId": "dev_01JD3Q8Z4T7M2K9XW5B6C0HFRA",
"notificationId": "ntf_01JD3QF1V6N8R2Y4P7S9T0AKME",
"receiptRequested": true
}
receiptRequested is true when the opened push carried a receipt code (_r); the SDK sets it. An open counts toward Delivered only for a push that asked for a receipt, so older SDKs, which never send it, add nothing to Delivered.
Opens show in the notification’s counts.opened and on each delivery as openedAt.
POST /v1/receipts
No API key. The Notification Service Extension helper on the phone posts the signed code it finds in the push’s _r along with the notification ID; the code itself is the proof, so the SDK’s extension calls this and you don’t need to. 204 for a valid receipt, and again for a repeat, which counts once. 403 for a code that doesn’t verify for that notification, 404 for an unknown or expired notification, and 429 when the server is over its limit for receipts: that receipt is dropped, so Delivered is a lower bound.
{
"notificationId": "ntf_01JD3QF1V6N8R2Y4P7S9T0AKME",
"receipt": "lAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
Receipts show in the notification’s counts.delivered and on each delivery as deliveredAt.