Closed ssvaghasiya closed 1 year ago
any solution? and also it's working fine with 1.5.0-beta01 version
it's not working with latest version
Not for now. As a workaround you could use a native UIViewController presented modally called on LocalUIViewController.current
with web view inside.
how to use any reference or please provide some detail explanation with example
Could you be more specific about what you struggle to figure out in particular?
Could you be more specific about what you struggle to figure out in particular?
When camera open from webview don't go back so any solution with example related to compose multiplatform.
It goes back, because ComposeScene is destroyed, and hence interop view is also destroyed.
In order for web view not to get destroyed, you could present a native UIViewController
with that web view and wire in the callbacks.
Have a look at this code to have a better idea how to do it. https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/compose/mpp/demo/src/uikitMain/kotlin/NativePopupExample.kt
To persist your state (navigation route, for example) across ComposeScene reconstructions, store it outside of the composition.
It goes back, because ComposeScene is destroyed, and hence interop view is also destroyed. In order for web view not to get destroyed, you could present a native
UIViewController
with that web view and wire in the callbacks.Have a look at this code to have a better idea how to do it. https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/compose/mpp/demo/src/uikitMain/kotlin/NativePopupExample.kt
To persist your state (navigation route, for example) across ComposeScene reconstructions, store it outside of the composition.
so how it's working with 1.5.0-beta01 version?
Because the interop view (web view in your case) was erroneously still in the uikit hierarchy, which was a bug of beta01: https://github.com/JetBrains/compose-multiplatform/issues/3749
Because the interop view (web view in your case) was erroneously still in the uikit hierarchy, which was a bug of beta01: #3749
Below is my current code so what solution apply to resolve the issue? https://gist.github.com/ssvaghasiya/d69f12b1987b7a775ee08e63ca4e0264
Hello @elijah-semyonov please provide solution for above code
I suggested a solution and an example in https://github.com/JetBrains/compose-multiplatform/issues/3791#issuecomment-1753038883 . It's up to you to figure it out. If it's still not clear, discuss it with fellow community members in the Kotlin Slack.
I suggested a solution and an example in #3791 (comment) . It's up to you to figure it out. If it's still not clear, discuss it with fellow community members in the Kotlin Slack.
issue resolved in upcoming release?
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
When i open camera and close camera in webview webview close automatically
example video: https://github.com/JetBrains/compose-multiplatform/assets/49331161/2ef4381a-c8cb-46ff-a552-42269ed37aec