Customize
- open
- add
- add
- add the below function to line 51:
Ok done in payload. Push now accept subtitle for
Open
OK DONE :)
Restart your
#pushd #ios #title #subtitle #coffee_script #push #notification
pushd server to add a new field like subtitle or title for iOS push notification payload. As you may know ios payload is like below:{
"aps":{
"alert":{
"body":"New flight is booked",
"title":"Boarding at 20:05",
"subtitle": ""Yay!
},
"category":"openFlightCategory"
},
}pushd by default does not support subtitle in the payload, to add this do the following:- open
/usr/local/pushdcustomized/lib/payload.coffee file- add
@subtitle = {} to line 14- add
when 'subtitle' then @subtitle.default = value to line 28- add the below function to line 51:
localizedMessage: (lang) ->
@localized('subtitle', lang)
Ok done in payload. Push now accept subtitle for
iOS, but there is one step left. You need to send subtitle to iOS device.Open
/usr/local/pushdcustomized/lib/pushservices/apns.coffee file and go to line note.alert = alert (line 44), and change it to:note.alert = {'title':payload.title.default, 'body':payload.msg.default, 'subtitle': payload.subtitle.default}OK DONE :)
Restart your
pushd server and enjoy title and subtitle in your iOS push notifications.#pushd #ios #title #subtitle #coffee_script #push #notification