-
Notifications
You must be signed in to change notification settings - Fork 381
Advanced APNs Features
Jorge Oliveira Santos edited this page Oct 9, 2019
·
3 revisions
n = Rpush::Apns::Notification.new
n.mdm = "magic"
n.save!Please refer to Apple's documentation (Tables 3-1 and 3-2).
There might be some cases where you'll need to add extra headers to the APNS call. E.g. From iOS 13 onwards, silent notifications can only be sent if you include the apns-push-type header with the background value. More details on custom headers here.
To include a custom header, simply include the headers hash on your notification payload:
n = Rpush::Apnsp8::Notification.new
n.data = {
'headers' => {
'apns-push-type' => 'background'
}
<rest of your payload here>
}