├ 10
receipts
After you send, poll the receipt to see whether APNs or FCM accepted the message:
const receipt = await client.getReceipt(ticket.id);
if (receipt.status === "delivered") {
console.log("● delivered");
} else if (receipt.status === "failed") {
console.log("● failed:", receipt.error);
if (receipt.tokenInvalid) {
// Remove the token from your database
}
}