Skip to content

MOBILEWEBVIEW-3: Add mindbox webview#29

Merged
enotniy merged 3 commits into
developfrom
feature/MOBILEWEBVIEW-3
Jan 21, 2026
Merged

MOBILEWEBVIEW-3: Add mindbox webview#29
enotniy merged 3 commits into
developfrom
feature/MOBILEWEBVIEW-3

Conversation

@enotniy
Copy link
Copy Markdown
Collaborator

@enotniy enotniy commented Jan 20, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a cross-platform WebView abstraction for the Mindbox SDK to support in-app messaging functionality. The implementation provides platform-specific WebView wrappers for Android and iOS with a common interface layer.

Changes:

  • Added a common WebView interface layer with data models and controller interface
  • Implemented Android-specific WebView controller with JavaScript bridge support
  • Created iOS platform stub using typealias for platform view integration

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
mindbox-common/src/commonMain/kotlin/cloud/mindbox/mobile_sdk/annotations/InternalMindboxApi.kt Added internal API annotation to restrict usage to SDK internals
mindbox-common/src/commonMain/kotlin/cloud/mindbox/mobile_sdk/inapp/webview/WebViewInterfaces.kt Defined common WebView interfaces, data classes, and controller contract
mindbox-common/src/androidMain/kotlin/cloud/mindbox/mobile_sdk/inapp/webview/WebViewAndroid.kt Implemented Android WebView controller with event handling and JavaScript bridge
mindbox-common/src/iosMain/kotlin/cloud/mindbox/mobile_sdk/inapp/webview/WebViewIos.kt Added iOS platform typealias stub for WebViewPlatformView

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +28
public fun interface WebViewJsBridge {
public fun getParam(key: String): String?

public fun onAction(action: String, data: String) {
}
}
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The interface declares itself as 'fun interface' (SAM interface) but contains two methods. SAM interfaces must have exactly one abstract method. Either remove the 'fun' keyword to make it a regular interface, or remove the onAction method with its default implementation to maintain SAM compatibility.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +36
public fun interface WebViewEventListener {
public fun onPageFinished(url: String?)

public fun onError(error: WebViewError) {
}
}
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The interface declares itself as 'fun interface' (SAM interface) but contains two methods. SAM interfaces must have exactly one abstract method. Either remove the 'fun' keyword to make it a regular interface, or remove the onError method with its default implementation to maintain SAM compatibility.

Copilot uses AI. Check for mistakes.
@SuppressLint("SetJavaScriptEnabled")
private fun configureWebView() {
with(webView.settings) {
javaScriptEnabled = true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Думаешь эти настройки останутся такими же и нам не надо выносить возможность их задавать при инициализации?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

думаю сейчас все оставить внутри. Пока сомнительно, чтобы что-то поменялось

@enotniy enotniy merged commit 6720b2a into develop Jan 21, 2026
4 checks passed
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.

4 participants