urbanairship / ios-library

Urban Airship iOS SDK
http://urbanairship.com
Apache License 2.0
478 stars 265 forks source link

Preference Center crash #416

Closed ppluskota closed 1 month ago

ppluskota commented 1 month ago

❗For how-to inquiries involving Airship functionality or use cases, please contact (support)[https://support.airship.com/].

Preliminary Info

What Airship dependencies are you using?

Airship Core, MessageCenter, Automation, PreferenceCenter - Version 18.11.0

What are the versions of any relevant development tools you are using?

Xcode 15.4, iOS 18, macOS Sonoma 14.7, CocoaPods 1.15.2

Report

What unexpected behavior are you seeing?

There is a Preference Center crash when I'm trying to open it. Here is the screenshot with the crash:

2024-10-15 o 08 02 52

What is the expected behavior?

The app shouldn't crash

What are the steps to reproduce the unexpected behavior?

You can just open the Preference Center screen. I'm using an app based on UIKit. Here is the code:

    Task { @MainActor in
        var theme = PreferenceCenterTheme()
        theme.viewController = PreferenceCenterTheme.ViewController(
            navigationBar: PreferenceCenterTheme.NavigationBar(
                title: "Notifications",
                backgroundColor: .label
            )
        )

        theme.contactSubscription = PreferenceCenterTheme.ContactSubscription(
            titleAppearance: PreferenceCenterTheme.TextAppearance(
                font: .headline
            ),
            subtitleAppearance: PreferenceCenterTheme.TextAppearance(
                font: .caption
            )
        )

        PreferenceCenter.shared.theme = theme
        PreferenceCenter.shared.open("some_valid_id")
    }
crow commented 1 month ago

@ppluskota Thanks for the report. We'll get a patch out shortly.

rlepinski commented 1 month ago

Fixed in 18.11.1