Is it possible to set the title of a push notification? It looks like what I'm calling the title of the notification is simply the name of the associated application. I have not seen anything in the docs that mention any way to set this value. In the iOS5 notification pull-down view, emails show up with name of the sender and the subject as the title. Is this possible, or is the OS rendering email notifications in a special way?
No, this is not possible. It will always use the name of the application as the title. There's no public API to set the title.
Update: This is now possible for iOS 8.2+ devices. Use the title
parameter in the aps
dictionary to set a custom title.
This is possible. Apple introduced changes in payload which allows this but will be supported from iOS 8.2
Use alert key to send the title and body. Here title will be replaced by your app name and body will be the message.
-- From Apple Docs --
alert
string or dictionaryIf this property is included, the system displays a standard alert or a banner, based on the user’s setting.
You can specify a string or a dictionary as the value of alert. If you specify a string, it becomes the message text of an alert with two buttons: Close and View. If the user taps View, the app launches. If you specify a dictionary, refer to Table 5-2 for descriptions of the keys of this dictionary.
title
stringA short string describing the purpose of the notification. Apple Watch displays this string as part of the notification interface. This string is displayed only briefly and should be crafted so that it can be understood quickly. This key was added in iOS 8.2.
body
stringThe text of the alert message.
© 2022 - 2024 — McMap. All rights reserved.