IOS Notifications

How to create push notification for iOS

Visible notifications

Visible notifications is the most common type of notifications. Users receive a message, which is displayed in the notification center of their devices.

Languages

It is possible to sent notifications in several languages to make them more accessible to users from different countries. When the language used on a device is specified among languages of the campaign, the notification is sent in this language. In case there is no device language among languages of the campaign, the message is sent in the language that is specified as a default language.

To add or remove a language press the button with a ‘+’ sign.

First, you need to choose the language that will be used by default. In most cases it is English.

Each language is presented in a form of a tab. When switching between tabs, please fill the required fields with translations. Translations are necessary for such fields as ‘Title’, ‘Text’ and ‘Share text’ (if it is used). The rest of notification settings are general and do not depend on translations.

Title

A short line that describes the purpose of notification. Apple Watch displays this line as a part of notification interface. This line is displayed only briefly and should be written so that it can be understood quickly. This key was added in iOS 8.2.

Alert/body

The text of the alert message.

As long as the title and text are sent in a Unicode format, you can use texts and emoji supported by this format to diversify the way your notifications look. The list of available emoji is here. We recommend you to test how messages with emoji are displayed on a device before sending them to wide audiences.

Badge

Optional. The number to be displayed as the badge of the app icon. If this property is absent, the badge is not changed. To remove the badge, set the value of this property to 0.

Sound

The value of this field is the name of a sound file in your app’s main bundle or in the Library/Sounds folder of your app’s data container. The sound in this file is played as an alert. If the sound file cannot be found or if you specify “default” as the value, the system plays the default alert sound.

The audio must be in one of the audio data formats that are compatible with system sounds; see Preparing Custom Alert Sounds for details.

Attachment

Available from devtodev iOS SDK 1.9, Cordova SDK 1.9, Unity SDK 2.3, UE4 SDK 1.9, Air SDK 1.8

Attachment delivery is available from iOS 10.

It is possible to attach image, video, audio, and GIF to your notification. Specify the type of an attachment ("image", "audio" or "video") and URL that leads to a media file. Please note that iOS uses only “https” protocol.

The following file formats can be used in attachments: "jpg", "jpeg", "png", "gif", "aif", "aiff", "mp3”, "wav","mpg", "mpeg", "mp4", "m4a", "avi".

The maximum file size that can be used in attachments is 5MB for audio files, 10MB for images and animation, 50MB for videos.

When using this option, keep in mind that attachments will not be displayed on some old devices. So create your messages in a way that they are informative even if the attachment is not displayed.

We recommend to optimize media files so that they are of a good quality and the minimum size. There is no point in sending images, which are more than 750 pixels wide.

If you use ad video, try to make it short and not use resolution formats above 720p (576p will be enough) with low frame frequency (24-25 frames per second.)

Images and videos are scaled proportionally along the width of notification display area.

Collapse key

Multiple notifications with the same collapse identifier are displayed to users as a single notification.

Parameters

You can pass custom parameters with messages and use them within an app. For instance, you can activate advertising campaign or any other functionality for a user who has received this message.

With this function you will be able to send any data, the processing of which can be pre-programmed, in a key-value format to the app. For example, it is possible to activate a promotion or perform any other activity within the app.

Interaction

Action

The action after a click on the body of a notification. By default, a click opens an app. It is possible to perform the following actions:

  • Home screen - this is the default behavior when a user taps on a push notification. It opens app’s home screen

  • Deep link - directs the user to a specific resource either within your app or on the web

  • Web page - opens a web page in a mobile browser or any valid device-level URL, such as Google Play or app protocol links

  • Share - the ‘Share’ action drives users to share your message when they interact with your push notification. In case of selecting this action, don’t forget to specify translations of share texts into all languages used in your push campaign

Buttons

Before choosing the template of notification buttons, it is necessary to select the language of the message, which will be used by default (usually it is English).

Accessible button templates can be found in the table with button templates or directly in the interface.

After you have selected the template, you need to set the action of the button. We do not recommend to use actions that contradict the text on the button. Templates, which have a ‘Dismiss notification’ label, cannot have any other action except for closing the notification. In case you are not satisfied with the template you have chosen, you can replace (‘Set another template’ button) or delete it.

The set of accessible actions:

  • Home screen - this is the default behavior when a user taps on a push notification. It opens app’s home screen

  • Deep link - directs the user to a specific resource either within your app or on the web

  • Web page - opens a web page in a mobile browser or any valid device-level URL, such as Google Play or app protocol links

  • Share - the ‘Share’ action drives users to share your message when they interact with your push notification. In case of selecting this action, don’t forget to specify the translations of share texts into all languages used in your push campaign

Invisible notifications

Invisible notifications can be used in case you need to send some command to an app and make it invisible to users. Users will not see the message and will not be notified by a special notification signal. This kind of notification is aimed at the app, not users.

Parameters used for sending the data to the app are the same as described in the section about visible notifications.

Content available

Provide this checkbox to indicate that new content is available. This is used to support newsstand apps and background content downloads. Newsstand apps are guaranteed to be able to receive at least one push with this key per 24-hour window.

Last updated

#989: best practices - improved readability

Change request updated