Skip to content

Commit

Permalink
Merge pull request #38 from plaidev/flutter
Browse files Browse the repository at this point in the history
[ios] dismiss in-app-message when the same experiments are triggered between the short period
  • Loading branch information
RyosukeCla authored Jun 4, 2024
2 parents 618c861 + 688601d commit e2873a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ios/Nativebrik/Nativebrik/component/root.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ModalRootViewController: UIViewController {
return page.data?.kind == PageKind.TRIGGER
}
self.modalViewController = modalViewController
self.modalViewController?.dismissModal()
self.container = container
super.init(nibName: nil, bundle: nil)

Expand Down Expand Up @@ -235,6 +236,9 @@ class RootView: UIView {

func findTopPresenting(_ viewContorller: UIViewController) -> UIViewController {
if let presented = viewContorller.presentedViewController {
if presented.isBeingDismissed {
return viewContorller
}
return findTopPresenting(presented)
} else {
return viewContorller
Expand Down
2 changes: 1 addition & 1 deletion ios/Nativebrik/Nativebrik/component/trigger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TriggerViewController: UIViewController {
private let user: NativebrikUser
private let container: Container
private var modalViewController: ModalComponentViewController? = nil
private var currentVC: UIViewController? = nil
private var currentVC: ModalRootViewController? = nil
private var didLoaded = false
private var ignoreFirstUserEventToForegroundEvent = true

Expand Down

0 comments on commit e2873a2

Please sign in to comment.