UNUserNotificationCenter

extension UNUserNotificationCenter: MoEngageUNUserNotificationCenter

Extension making UNUserNotificationCenter conform to MoEngageUNUserNotificationCenter.

This extension enables the real UNUserNotificationCenter to be used interchangeably with mock implementations through the protocol abstraction.

  • Implements delegate change observation for UNUserNotificationCenter.

    This method wraps the standard KVO API to provide a simpler interface for observing delegate changes.

    Declaration

    Swift

    public func observeDelegateChanges(
        changeHandler: @Sendable @escaping (
            _ oldDelegate: UNUserNotificationCenterDelegate?,
            _ newDelegate: UNUserNotificationCenterDelegate?
        ) -> Void
    ) -> NSKeyValueObservation

    Parameters

    changeHandler

    Called when the delegate property changes.

    Return Value

    The KVO observation object.