
In-app notification settings that allow your users to customize which of your notifications they receive. Allows you to build high quality, flexible preference settings very quickly.
Requirement | Reason |
---|---|
Authentication
|
Needed to view preferences that belong to a user. |
CourierPreferences
works with all native iOS UI frameworks.
UI Framework | Support |
---|---|
UIKit |
✅ |
XIB |
|
SwiftUI |
✅ |
The default CourierPreferences
styles.

import Courier_iOS
// UIKit
// Create the view
let courierPreferences = CourierPreferences(
mode: .topic,
onError: { error in
print(error.localizedDescription)
}
)
// Add the view to your UI
courierPreferences.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(courierPreferences)
// Constrain the view how you'd like
NSLayoutConstraint.activate([
courierPreferences.topAnchor.constraint(equalTo: view.topAnchor),
courierPreferences.bottomAnchor.constraint(equalTo: view.bottomAnchor),
courierPreferences.leadingAnchor.constraint(equalTo: view.leadingAnchor),
courierPreferences.trailingAnchor.constraint(equalTo: view.trailingAnchor),
])
// SwiftUI
var body: some View {
CourierPreferencesView(
mode: .topic,
onError: { error in
print(error.localizedDescription)
}
)
}
The styles you can use to quickly customize the CourierPreferences
.

import Courier_iOS
let textColor = UIColor(red: 42 / 255, green: 21 / 255, blue: 55 / 255, alpha: 100)
let primaryColor = UIColor(red: 136 / 255, green: 45 / 255, blue: 185 / 255, alpha: 100)
let secondaryColor = UIColor(red: 234 / 255, green: 104 / 255, blue: 102 / 255, alpha: 100)
// Theme object containing all the styles you want to apply
let preferencesTheme = CourierPreferencesTheme(
brandId: "7S9R...3Q1M", // Optional. Theme colors will override this brand.
loadingIndicatorColor: secondaryColor,
sectionTitleFont: CourierStyles.Font(
font: UIFont(name: "Avenir Black", size: 20)!,
color: .white
),
topicCellStyles: CourierStyles.Cell(
separatorStyle: .none
),
topicTitleFont: CourierStyles.Font(
font: UIFont(name: "Avenir Medium", size: 18)!,
color: .white
),
topicSubtitleFont: CourierStyles.Font(
font: UIFont(name: "Avenir Medium", size: 16)!,
color: .white
),
topicButton: CourierStyles.Button(
font: CourierStyles.Font(
font: UIFont(name: "Avenir Medium", size: 16)!,
color: .white
),
backgroundColor: secondaryColor,
cornerRadius: 8
),
sheetTitleFont: CourierStyles.Font(
font: UIFont(name: "Avenir Medium", size: 18)!,
color: .white
),
sheetSettingStyles: CourierStyles.Preferences.SettingStyles(
font: CourierStyles.Font(
font: UIFont(name: "Avenir Medium", size: 18)!,
color: .white
),
toggleColor: secondaryColor
),
sheetCornerRadius: 0,
sheetCellStyles: CourierStyles.Cell(
separatorStyle: .none
)
)
// UIKit
// Pass the theme to the view
let courierPreferences = CourierPreferences(
mode: .channels([.push, .sms, .email]),
lightTheme: preferencesTheme,
darkTheme: preferencesTheme,
onError: { error in
print(error.localizedDescription)
}
)
view.addSubview(courierPreferences)
...
// SwiftUI
var body: some View {
CourierPreferencesView(
mode: .topic,
lightTheme: preferencesTheme,
darkTheme: preferencesTheme,
onError: { error in
print(error.localizedDescription)
}
)
}
You can control your branding from the Courier Studio
.
Supported Brand Styles | Support |
---|---|
Primary Color |
✅ |
Show/Hide Courier Footer |
✅ |
👋 Branding APIs
can be found here
👋 Preference APIs
can be found here