iOS: Image Carousel Push Notifications
How to implement an image carousel in OneSignal iOS push notifications using Swift.
iOS provides a UNNotificationContentExtension protocol as the entry point for a notification content app extension. This can be used to display a custom interface for your app’s notifications. This example guide explains how to use this for creating a carousel within an iOS notification.
Image showing a carousel in a push notification
1. Add a notification content extension

In Xcode, select File > New > Target…

Select “Notification Content Extension”

Confirm the selection on the window that pops up

Select activate to debug
2. Add code to your app
Download the OSNotificationContentExtension from Github and replace the OSNotificationContentExtension
in your Xcode Project with the same file from Github.
You should see the following files added:
Files under Content Extension
3. Set your notification category
This example Declares The Actionable Notification Type within the AppDelegate.swift didFinishLaunchingWithOptions
.
4. Send your push notification
When Sending Push Messages you can set the iOS Category and custom Data.
iOS category
Use OSNotificationCarousel
as the iOS Category:
Set under “Platform Settings” > Send to Apple iOS > “Category”
iOS platform options on OneSignal dashboard
Set under “Platform Settings” > Send to Apple iOS > “Category”
iOS platform options on OneSignal dashboard
Set with the ios_category
API Parameter.
Custom data
OneSignal doesn’t have an option to upload multiple images per notification.
Instead you must list the Image URLs separated by a comma ,
Set under “Advanced Settings” > “Additional Data”
For the “Key” set images
and the “Value” set the list of comma separated URLs without quotes.
Example, copy paste:
Set under “Advanced Settings” > “Additional Data”
For the “Key” set images
and the “Value” set the list of comma separated URLs without quotes.
Example, copy paste:
Use the data
API Parameter like this:
Send the push
Once you receive the push, you will need to long press or swipe left and click “View” to expand the notification depending on the iOS version.