MoEngagePushAccessibility

public class MoEngagePushAccessibility

A utility class for handling accessibility data in push notifications. This class provides methods to fetch and assess accessibility information from push payloads, ensuring that the content displayed adheres to accessibility settings on the device.

  • Declaration

    Swift

    public static var accessibilityUtil: MoEngageAccessibilityUtilProtocol
  • Fetches the accessibility data for a given push payload.

    Declaration

    Swift

    public static func fetchAccessibilityData(for payload: MoEngagePushPayload) -> MoEngageAccessibilityData?

    Parameters

    payload

    The push notification payload that may contain rich push and accessibility data.

    Return Value

    An optional instance of MoEngageAccessibilityData if accessibility data is available and applicable; otherwise, nil.

  • Determines whether to replace the backup content for the provided push payload.

    The function evaluates the rich push payload to determine if fallback content should be displayed. If the payload does not contain rich push data, the function immediately returns false. When the payload includes rich push content that specifies an ImageCarousel as the template, t checks whether accessibility features are enabled on the device. I f accessibility is enabled in this context, the backup content is not replaced (returning false); otherwise, the function returns true.

    Declaration

    Swift

    public static func shouldReplaceBackUpContent(for payload: MoEngagePushPayload) -> Bool

    Parameters

    payload

    The push payload that may include rich push information along with expanded mode settings.

    Return Value

    A Boolean value indicating whether the backup content should be replaced.

  • Determines if a resource from the rich push payload should be considered based on its template type and device accessibility settings.

    Declaration

    Swift

    public static func shouldConsiderResourceFromRichPush(for payload: MoEngagePushPayload) -> Bool

    Parameters

    payload

    The rich push payload containing details including the expanded mode and its associated template type.

    Return Value

    A Boolean value indicating whether the resource should be considered:

  • Determines if backup content should be considered for a given push payload.

    Declaration

    Swift

    public static func shouldReplaceBackUpContent(for payload: [AnyHashable : Any]) -> Bool

    Parameters

    payload

    The push notification payload to evaluate.

    Return Value

    A Boolean value indicating whether backup content should be considered (true) or not (false).