diff --git a/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt b/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt index 9bc3a81..2e97baf 100644 --- a/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt +++ b/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt @@ -25,7 +25,7 @@ import org.json.JSONObject class RNSession( private val reactContext: ReactApplicationContext, private val sessionHandle: String, - private val applicationNameForUserAgent: String? + private val applicationNameForUserAgent: String?, ) : SessionCallbackAdapter { var visitableView: SessionSubscriber? = null @@ -46,6 +46,10 @@ class RNSession( val webView: TurboWebView get() = turboSession.webView val currentVisit: TurboVisit? get() = turboSession.currentVisit + internal fun registerVisitableView(newView: SessionSubscriber) { + visitableView = newView + } + private fun setUserAgentString(webView: TurboWebView, applicationNameForUserAgent: String?) { var userAgentString = WebSettings.getDefaultUserAgent(webView.context) if (applicationNameForUserAgent != null) { @@ -54,10 +58,6 @@ class RNSession( webView.settings.userAgentString = userAgentString } - internal fun registerVisitableView(newView: SessionSubscriber) { - visitableView = newView - } - fun visit(url: String, restoreWithCachedSnapshot: Boolean, reload: Boolean, viewTreeLifecycleOwner: LifecycleOwner?, visitOptions: TurboVisitOptions?){ val restore = restoreWithCachedSnapshot && !reload