MOBILEWEBVIEW-3: Add mindbox webview#29
Conversation
There was a problem hiding this comment.
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.
| public fun interface WebViewJsBridge { | ||
| public fun getParam(key: String): String? | ||
|
|
||
| public fun onAction(action: String, data: String) { | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
| public fun interface WebViewEventListener { | ||
| public fun onPageFinished(url: String?) | ||
|
|
||
| public fun onError(error: WebViewError) { | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
| @SuppressLint("SetJavaScriptEnabled") | ||
| private fun configureWebView() { | ||
| with(webView.settings) { | ||
| javaScriptEnabled = true |
There was a problem hiding this comment.
Думаешь эти настройки останутся такими же и нам не надо выносить возможность их задавать при инициализации?
There was a problem hiding this comment.
думаю сейчас все оставить внутри. Пока сомнительно, чтобы что-то поменялось
https://tracker.yandex.ru/MOBILEWEBVIEW-3