Closed remarcus closed 1 year ago
Hi @remarcus,
Thank you for opening this issue. The method presentNext()
currently work as intended and does not call the delegate. We'll update the documentation accordingly.
To achieve the desired behavior, you can do something like:
if let message = inAppMessageUI.stack.last {
// Call the default presenter protocol method
// → executes the `inAppMessage(_:displayChoiceForMessage:)` delegate method
inAppMessageUI.present(message: message)
}
The message is automatically removed from the stack when presented.
Let us know if that works for you.
Thanks @lowip,
It seems to work great now. I will close the issue, if we will find something during testing I will update the issue.
Have a great day!
Platform
iOS
Platform Version
16.5.1
Braze SDK Version
6.3.1
Xcode Version
14.3.1
Computer Processor
Apple (M1)
Repro Rate
100%
Steps To Reproduce
Example:
BrazeInAppMessageUIDelegate
containingdisplayChoice(for:)
.later
display choice for In App MessagepresentNext()
on the presenterExpected Behavior
displayChoice(for:)
is invoked and decision can be made about the given campaignActual Incorrect Behavior
inAppMessage(_ ui:, willPresent:, view:)
is invokedVerbose Logs
No response
Additional Information
We want to control the In App Message display logic and we used to do that with
Appboy.sharedInstance()!.inAppMessageController.displayNextInAppMessage()
. This method used to repeat going through the display choice flow.My question is this a bug or a custom implementation of
BrazeInAppMessagePresenter
should be considered.For HTML and Control campaigns we use Braze UI to handle the message, for other type of campaigns we display them by using our own UI library. So we have to have availability to both.