braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: InApp Modal height (blank space is taking the whole screen) #90

Closed phlourenco closed 1 year ago

phlourenco commented 1 year ago

Platform

iOS

Platform Version

iOS 17.0.3

Braze SDK Version

7.1.0

Xcode Version

Xcode 15.0.1

Computer Processor

Apple (M1)

Repro Rate

100% of the time

Steps To Reproduce

To reproduce, just send an InApp modal campaign or open a local modal with at least one button.

Sample code snippet that can be used on the Example project:

    let modal: Braze.InAppMessage = .modal(
        BrazeKit.Braze.InAppMessage.Modal(
            data: .init(
                clickAction: .none,
                messageClose: .userInteraction,
                orientation: .any,
                animateIn: true,
                animateOut: true
            ),
            graphic: .none,
            header: "Title",
            headerTextAlignment: .center,
            message: "Message",
            messageTextAlignment: .center,
            buttons: [
                .init(id: 0, text: "Button 1", clickAction: .none, themes: .defaults),
                .init(id: 1, text: "Button 2", clickAction: .none, themes: .defaults)
            ],
            themes: .defaults
        )
    )
  AppDelegate.braze?.inAppMessagePresenter?.present(message: modal)

Expected Behavior

Braze SDK 6.6.0 iPhone 15 Pro Max (simulator)

Simulator Screenshot - iPhone 15 Pro Max - 2023-11-05 at 20 38 58

Actual Incorrect Behavior

Braze SDK 7.1.0 iPhone 15 Pro Max (simulator)

Simulator Screenshot - iPhone 15 Pro Max - 2023-11-05 at 20 32 55

Verbose Logs

No response

Additional Information

  1. As you can see on the screenshots, this bug doesn't happen with Braze SDK 6.6.0.
  2. After some investigation, it looks that this bug was introduced on 7.0.0, on the ModalTextView.
  3. I noticed that this only happens when there are buttons in the modal. If I don't add buttons, the size is normal:

iPhone 15 Pro Max (simulator) Simulator Screenshot - iPhone 15 Pro Max - 2023-11-05 at 20 41 55

  1. Apparently this bug doesn't happen on small screens.

iPhone SE 3rd generation (simulator) Simulator Screenshot - iPhone SE (3rd generation) - 2023-11-05 at 20 33 51

jerielng commented 1 year ago

Hey @phlourenco, thanks for reporting this. This is an issue that's on our radar, and we'll keep you updated on a fix as soon as we can. I noticed that you're able to reproduce this issue on a simulator, which we haven't been able to so far. Do you happen to have any details about the campaign and the device environment you used to produce this (i.e. which version(s) of iOS are you observing this on?)

phlourenco commented 1 year ago

Hey @phlourenco, thanks for reporting this. This is an issue that's on our radar, and we'll keep you updated on a fix as soon as we can. I noticed that you're able to reproduce this issue on a simulator, which we haven't been able to so far. Do you happen to have any details about the campaign and the device environment you used to produce this (i.e. which version(s) of iOS are you observing this on?)

Hey @jerielng, I reproduced it on an iPhone 15 Pro Max simulator with iOS 17. And you don't need a campaign. You can use the code snippet I provided to reproduce it locally.

jerielng commented 1 year ago

Hey @phlourenco, updating here: We've released 7.2.0 of the Swift SDK, so this should now be resolved. Please let us know if you have any further questions/concerns.