Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: inAppMessage(_ ui: BrazeInAppMessageUI, willPresent message: Braze.InAppMessage, view: InAppMessageView) not called #116

Closed
iOHS opened this issue Mar 23, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@iOHS
Copy link

iOHS commented Mar 23, 2024

Platform

iOS

Platform Version

iOS 16.2

Braze SDK Version

5.14.0

Xcode Version

Xcode 14.3

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

  1. inappmessage exposure
  2. check willPresent call

Expected Behavior

willPresent is called.

Actual Incorrect Behavior

willPresent is not called.

Verbose Logs

No response

Additional Information

Hello. BrazeInAppMessageUIDelegate is set correctly, but willPresent is not called.
displayChoiceForMessage and prepareWith are called normally

let inAppMessageUI = BrazeInAppMessageUI()
inAppMessageUI.delegate = self
self.braze?.inAppMessagePresenter = inAppMessageUI as? BrazeInAppMessagePresenter

Is this due to the difference between calling delegate?.inAppMessage(self, prepareWith: &context) and calling ui.delegate?.inAppMessage(ui, willPresent: controller.message, view: self)
Please check how we can handle it.

extension BrazeTracker: BrazeInAppMessageUIDelegate {
    
    func inAppMessage(_ ui: BrazeInAppMessageUI, willPresent message: Braze.InAppMessage, view: InAppMessageView) {
        print("not called")
    }

    func inAppMessage(_ ui: BrazeInAppMessageUI, displayChoiceForMessage message: Braze.InAppMessage) -> BrazeInAppMessageUI.DisplayChoice {
        self.isTopViewControllerExcluded() ? .later : .now
    }
    
    func inAppMessage(_ ui: BrazeInAppMessageUI, prepareWith context: inout BrazeInAppMessageUI.PresentationContext) {
        print("called")
    }
}

Only BrazeInAppMessageUIDelegate declared in the SDK is being called.

extension BrazeInAppMessageUIDelegate {

  public func inAppMessage(
    _ ui: BrazeInAppMessageUI, willPresent message: Braze.InAppMessage,
    view: InAppMessageView
  ) {}
}
@iOHS iOHS added the bug Something isn't working label Mar 23, 2024
@lowip
Copy link
Collaborator

lowip commented Mar 25, 2024

Hi @iOHS,

Thank you for reporting this issue. Unfortunately, we haven't been able to reproduce it yet. Could you send the link to the campaign for which you're experiencing the problem to support@braze.com, please also reference this GitHub issue thread in your email.

We'll be able to take a better look once we have those information.

Best,

@iOHS
Copy link
Author

iOHS commented Apr 1, 2024

@lowip I sent you an email.
thank you

@hokstuff
Copy link
Collaborator

I'm closing out this thread due to inactivity and because we are conversing directly through our Support channels, which will be easier for back-and-forth. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants