Iterable campaigns can send iOS push notifications. Push notifications are remotely-triggered notifications that appear on a user's device even when the application is closed (depending on whether or not the user allows them). Users can then tap on these notifications to open the associated application to specific, relevant content.
This is a technical guide that describes various one-time configuration and implementation steps to complete before sending iOS push notifications from Iterable campaigns. It is targeted at engineers who build iOS apps.
If you are a marketer, work with your mobile engineers to implement the steps discussed in this article. If you have already completed the technical setup, learn more about setting up a push notification campaign by reading Creating a push notification campaign.
For information on sending Android push notifications from Iterable, read Setting up Android push notifications.
Table of contents
This guide covers the following topics:
- Set up Apple developer certificates for iOS push notifications
- Add the iOS push notifications capability in Xcode
- Enable iOS push notifications for your App ID
- Configure Iterable settings for iOS push notifications
- Install Iterable's iOS SDK in your app
- Test that iOS push notifications are working
- Advanced setup
- Further reading
Set up Apple developer certificates for iOS push notifications
Create a Certificate Signing Request (.certSigningRequest) file
Open the Keychain Access app on your Mac.
Within the Keychain Access drop-down menu, select Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority:
Enter the following information:
Your email address
A name for the private key
Select Saved to Disk:
Remember where the file is saved, as you will upload it to Apple in the next step.
Follow Apple's instructions to obtain a provider certificate.
APNs (Apple's push notification service) currently supports two types of connections: token-based (.p8) and certificate-based (.p12). Iterable’s APNs push integration uses the certificate-based method.
In Apple's instructions, step 4 indicates to “Generate a Certificate Signing Request (CSR) on your server.” This corresponds to the generation of the .certSigningRequest file, above, in the Keychain Access app.
Upload your .certSigningRequest file in step 6 of Apple’s instructions.
Save the .cer file that the Apple website generates.
Double-click the .cer file to open it in Keychain Access.
On your Mac, in Keychain Access, select Keys and highlight your app's private key.
Choose File > Export Items....
Enter a name in the Save As field.
Accept the default .p12 file format and then choose Save.
Add the iOS push notifications capability in Xcode
To receive push notifications for an iOS app, you'll need to configure your Xcode project:
- In Xcode, in your target's Capabilities, enable Push Notifications.
Enable iOS push notifications for your App ID
In the Apple Developer Portal, enable push notifications for your App ID:
Log in to the Apple Developer Portal.
Navigate to Certificates, IDs & Profiles > Identifiers > App IDs and select your app.
Scroll to the bottom of the screen and click Edit.
Find the Push Notifications section, and enable them.
If you have trouble registering for push notifications for iOS 10+, read iOS 10 debugging: push notifications not registering for more information.
Configure Iterable settings for iOS push notifications
In Iterable, adding a push integration to a project makes it possible for that project to send iOS push notifications as part of its campaigns.
To create a push integration in Iterable:
Log in to Iterable.
Navigate to Integrations > Mobile Push > Create Push Integration.
Enter a name for your app (this will be the same name used later when initializing the SDK).
Select APNS or APNS Sandbox from the platforms drop-down (depending on which iOS environment you want to use).
Upload the .p12 file you generated earlier.
Click Create Integration.
Install Iterable's iOS SDK in your app
Iterable's iOS SDK facilitates working with iOS push notifications by automatically handling device token registration and notification tracking. However, it's also possible to do these things manually by calling Iterable's API.
Test that iOS push notifications are working
To test iOS push notifications, follow these instructions:
In Iterable, navigate to Integrations > Mobile Push and click the Send test push link that appears when you hover over the right-hand side of a row in the table.
Enter a token and a message.
Click Send Notification.
Verify that you receive the push notification.
Add sounds to iOS push notifications
To add sound to iOS push notifications, follow these instructions:
Place sound files in the iOS project's Library/Sound folder, or in the top-level directory of the Xcode project.
See the iOS documentation for the latest list of supported sound formats.
In Iterable, in the push template definition interface, put the name of the sound file in the Sound field:
- To use the default push notification sound, set this field to
- If the receiving device has notifications set to silent when a sound-enabled push notification arrives, the device will vibrate instead of playing the sound.
- To use the default push notification sound, set this field to
Update badges from iOS push notifications
To add badges to iOS push notifications:
Keep track of the badge count on each user's profile within Iterable, or access it via a data feed.
When sending a push notification, use Handlebars to set the badge count as a merge parameter on the push notification template. For example, for user profiles with a
badgeCountfield that stores the current badge count, specify
So, if a user profile has a
badgeCountfield with a value of 5, the badge on the iOS app's icon will be 5.
Add deep links to iOS push notifications
To add deep links to iOS push notifications:
- In the push template in Iterable, specify deep link URLs for each mobile platform.
- Refer to the iOS SDK documentation for details on how to handle these links.
If you're not using the SDK, retrieve the deep link URL from the
of the push notification payload.
Add media attachments to iOS push notifications
To add media attachments to display as part of an iOS push notification, you'll need to add a Notification Service Extension to your application.
For more information about push notifications in Iterable, read:
- Iterable's Push notification setup FAQ.