N
Novuβ€’11mo ago
sbeve

APNs ignoring overrides

Hey all! I'm not sure if this is the right place to post this but I figured I'd give it a shot. I'm currently using the APNs provider to send notifications to iOS devices. I've been testing it on my own device and it doesn't seem to be accepting overrides? I initially tried to set it up so it would use a sound that I provided. The sound worked when using the Apple Push Notification Console, but not when providing it through Novu. I also noticed that I can't send Time Sensitive notifications despite my app having the entitlement. I can provide code if needed, it currently just follows the format of:
novu.trigger("<name>", {
to: {
subscriberId: <id_variable>,
},
payload: {...},
overrides: {
apns: {
payload: {
aps: {
sound: <sound_name>,
},
},
},
},
});
novu.trigger("<name>", {
to: {
subscriberId: <id_variable>,
},
payload: {...},
overrides: {
apns: {
payload: {
aps: {
sound: <sound_name>,
},
},
},
},
});
I might just be tired and unable to figure it out? Is there any way around this? Thanks in advance!
2 Replies
Tomer Barnea
Tomer Barneaβ€’11mo ago
Hey @sbeve πŸ‘‹ firstly, this is the right place, much appreciated! @Emil, can you take it from here? πŸ™
empe
empeβ€’11mo ago
Het @sbeve! Are you getting any error message when triggering the event via Novu? Also, I've wrote this comprehensive guide on sending Push notification to iOS using FCM as a provider, but also triggering the workflow by calling Novu's API. Please have a look, maybe it should shed a bit more light on your situation: https://docs.novu.co/guides/FCM-iOS-Novu/how-to-send-PUSH-notifications-to-iOS-devices-with-FCM-using-Novu This API request should work:
curl --location --request POST 'https://api.novu.co/v1/events/trigger' \
--header 'Authorization: ApiKey <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "untitled",
"to": {
"subscriberId": "12345678"
},
"payload": {
"title": "Notification With Sound",
"body": "Hello World from Novu"
},
"overrides": {
"apns": {
"payload": {
"aps": {
"sound": "default" // configure sound to the notification
}
}
}
}
}
}'
curl --location --request POST 'https://api.novu.co/v1/events/trigger' \
--header 'Authorization: ApiKey <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "untitled",
"to": {
"subscriberId": "12345678"
},
"payload": {
"title": "Notification With Sound",
"body": "Hello World from Novu"
},
"overrides": {
"apns": {
"payload": {
"aps": {
"sound": "default" // configure sound to the notification
}
}
}
}
}
}'
Also, can you please verify that you have configured the subscriber's credentials? https://docs.novu.co/api-reference/subscribers/update-subscriber-credentials Also, please consider checking this section: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification?language=objc
Want results from more Discord servers?
Add your server