Skip to content

MOBILEWEBVIEW-34: Refactoring close inapp#687

Open
enotniy wants to merge 1 commit intomission/webview-inappfrom
feature/MOBILEWEBVIEW-34
Open

MOBILEWEBVIEW-34: Refactoring close inapp#687
enotniy wants to merge 1 commit intomission/webview-inappfrom
feature/MOBILEWEBVIEW-34

Conversation

@enotniy
Copy link
Collaborator

@enotniy enotniy commented Mar 4, 2026

@enotniy enotniy requested a review from sergeysozinov March 4, 2026 09:15
val view: WebViewPlatformView = controller.view
inAppLayout.removeView(view)
view.parent.safeAs<ViewGroup>()?.removeView(view)
controller.destroy()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут destroy вызывается и ещё ниже следом
webViewController?.destroy()

mindboxLogI("In-app dismissed by webview action ${message.action} with payload ${message.payload}")
hide()
release()
inAppController.close()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь и в других аналогичных местах с onInAppDismiss проблема будет:

Вызывается closeCurrentInapp , а там внутри

  if (isInAppActive()) {
                currentHolder?.wrapper?.inAppActionCallbacks
                    ?.copy(onInAppDismiss = { mindboxLogI("Do not save the closing timestamp for in-app as it's restored automatically when the session is reopened") })
                    ?.onInAppDismiss
                    ?.onDismiss()
            }

флаг isInAppActive мы нигде не сбрасываем в false.

Поэтому дисмисс внутри closeCurrentInApp так же выполнитится

controller.executeOnViewThread {
hide()
release()
inAppController.close()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не понимаю почему, но потестил и заметил , что при разворачивании приложения, где WebView каждый раз отправляется Inapp.Show и счетчики показа увеличиваются. Видимо из-за того что pausedHolder затираем

15:14:04.067  I  InAppMessageManagerImpl: Render time is 373602ms, prepared time is 452ms
15:14:04.067  I  InAppRepositoryImpl: Increase count of shown inapp per session, previous count 7
15:14:04.071  I  InAppRepositoryImpl: Increase count of shown inapp per day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants