// Example Node.js implementation using Express
app.post('/apple-notifications', async (req, res) => {
try {
// Forward the notification to Shinara
const response = await fetch('YOUR_SHINARA_WEBHOOK_URL', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
// Forward all original headers from Apple
...req.headers
},
body: JSON.stringify(req.body)
});
// Process the notification for your own needs
await processNotificationLocally(req.body);
// Return 200 to Apple only after successful forwarding
res.status(200).send('OK');
} catch (error) {
console.error('Forwarding failed:', error);
res.status(500).send('Error forwarding notification');
}
});