iOS SDK Old Versions Support

Manual push notifications setup

For SDK versions before 1.4.0 use processRemoteNotificationResponse(_:) method. Call this method only for openning app action (UNNotificationDefaultActionIdentifier).

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()
    }
    
}