This page describes SDK changes that may affect apps upgrading from earlier versions of the Reteno iOS SDK. For a new integration or the current setup flow, see iOS SDK Setup.
SDK Initialization and Configuration Changes
The following versions changed how the SDK is initialized or configured:
| SDK version | Change | What to update |
|---|---|---|
| 2.0.4 | Added RetenoConfiguration and a new Reteno.start(apiKey:configuration:) overload. | Use RetenoConfiguration for custom settings; the individual-argument overload remains available. |
| 2.5.10 | Added useCustomDeviceId. | When enabled, provide the ID through Reteno.customDeviceIdProvider.setDeviceId(_:). |
| 2.6.0 | Added deviceTokenHandlingMode to RetenoConfiguration. | Use .automatic for direct APNs integration or .manual for FCM and custom token handling. |
| 2.7.0 | Added foreground lifecycle reporting and configurable session tracking. | Replace isAutomaticSessionReportingEnabled with sessionConfiguration when customizing sessions. |
| 2.7.1 | Moved deviceTokenHandlingMode from RetenoConfiguration to all Reteno.start methods. | Pass the mode directly to Reteno.start; it is now required. |
SDK 2.0.4: RetenoConfiguration
RetenoConfigurationBefore SDK 2.0.4, optional settings were passed directly to Reteno.start:
Reteno.start(
apiKey: "SDK_ACCESS_KEY",
isAutomaticScreenReportingEnabled: false,
isDebugMode: false,
isPausedInAppMessages: false,
inAppMessagesPauseBehaviour: .postponeInApps
)Starting with SDK 2.0.4, you can group these and other SDK settings in RetenoConfiguration:
let configuration = RetenoConfiguration(
isAutomaticScreenReportingEnabled: false,
isPausedInAppMessages: false,
inAppMessagesPauseBehaviour: .postponeInApps,
isDebugMode: false
)
Reteno.start(
apiKey: "SDK_ACCESS_KEY",
configuration: configuration
)The overload with individual settings remained available for backward compatibility, but RetenoConfiguration is recommended for integrations that require custom SDK behavior.
SDK 2.5.10: Custom Device ID
SDK 2.5.10 added the useCustomDeviceId parameter to RetenoConfiguration. Its default value is false, so no changes are required unless your app supplies its own device ID.
When useCustomDeviceId is true, the SDK defers initialization until you call Reteno.customDeviceIdProvider.setDeviceId(_:). Call this method as soon as the ID is available:
let configuration = RetenoConfiguration(
useCustomDeviceId: true
)
Reteno.start(
apiKey: "SDK_ACCESS_KEY",
configuration: configuration
)
Reteno.customDeviceIdProvider.setDeviceId(deviceId)SDK 2.6.0: Device Token Handling Mode
SDK 2.6.0 added deviceTokenHandlingMode to RetenoConfiguration. The default value was .automatic.
.automatic— for sending notifications directly through APNs. The SDK obtains the APNs token through method swizzling, so you do not need to implementapplication(_:didRegisterForRemoteNotificationsWithDeviceToken:)..manual— for Firebase Cloud Messaging (FCM) or an existing custom token-registration flow.
For SDK versions 2.6.0–2.7.0, configure the mode as follows:
let configuration = RetenoConfiguration(
deviceTokenHandlingMode: .manual
)
Reteno.start(
apiKey: "SDK_ACCESS_KEY",
configuration: configuration
)When using .manual, provide the FCM or APNs token through Reteno.userNotificationService.processRemoteNotificationsToken(_:).
SDK 2.7.0: Lifecycle and Session Configuration
SDK 2.7.0 added the following parameters to RetenoConfiguration:
isApplicationForegroundLifecycleReportingEnabled— controls automatic reporting ofApplicationOpenedandApplicationBackgrounded. Its default value isfalse. This setting requiresisAutomaticAppLifecycleReportingEnabledto betrue.sessionConfiguration— controls the session duration and reporting ofSessionStartedandSessionEndedevents. It replaced the earlierisAutomaticSessionReportingEnabledflag.
The default RetenoSessionConfiguration uses a three-hour inactivity interval, enables SessionStarted, and disables SessionEnded.
To disable automatic session tracking and reporting, use:
let configuration = RetenoConfiguration(
sessionConfiguration: .disabled
)To define custom session behavior, create a RetenoSessionConfiguration:
let sessionConfiguration = RetenoSessionConfiguration(
sessionDuration: 60 * 60,
isSessionStartReportingEnabled: true,
isSessionEndReportingEnabled: true
)
let configuration = RetenoConfiguration(
isApplicationForegroundLifecycleReportingEnabled: true,
sessionConfiguration: sessionConfiguration
)SDK 2.7.1: Required deviceTokenHandlingMode
deviceTokenHandlingModeStarting with SDK 2.7.1, deviceTokenHandlingMode is no longer part of RetenoConfiguration. It is a required argument in every Reteno.start method.
For SDK versions 2.6.0–2.7.0, the mode was set in the configuration:
let configuration = RetenoConfiguration(
deviceTokenHandlingMode: .automatic
)
Reteno.start(
apiKey: "SDK_ACCESS_KEY",
configuration: configuration
)Starting with SDK 2.7.1, pass it directly to Reteno.start:
let configuration = RetenoConfiguration()
Reteno.start(
apiKey: "SDK_ACCESS_KEY",
deviceTokenHandlingMode: .automatic,
configuration: configuration
)Use .manual instead when using FCM or providing the push token yourself.
Push Notification Changes in Earlier Versions
SDK Versions Before 1.4.0: Manual Notification Response Processing
processRemoteNotificationResponse(_:) was added in SDK 1.4.0. With earlier SDK versions, process only the default action used to open the app and pass the notification to processOpenedRemoteNotification(_:):
extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(
_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
) {
completionHandler([.sound, .badge, .alert])
}
func userNotificationCenter(
_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void
) {
if response.actionIdentifier == UNNotificationDefaultActionIdentifier {
Reteno.userNotificationService.processOpenedRemoteNotification(
response.notification
)
}
completionHandler()
}
}Starting with SDK 1.4.0, pass the complete response instead:
Reteno.userNotificationService.processRemoteNotificationResponse(response)This method processes app opens and supported notification actions.
SDK 1.5.4: Notification Permission Response Closure
Starting with SDK 1.5.4, registerForRemoteNotifications accepts an optional closure with the user's response to the notification permission prompt. The application argument also defaults to UIApplication.shared:
Reteno.userNotificationService.registerForRemoteNotifications(
with: [.sound, .alert, .badge]
) { granted in
// granted == true when the user allows notifications
}For SDK versions before 1.5.4, pass application explicitly; the response closure is not available:
Reteno.userNotificationService.registerForRemoteNotifications(
with: [.sound, .alert, .badge],
application: application
)