@@ -152,6 +152,7 @@ import kotlinx.coroutines.Dispatchers.Default
152152import kotlinx.coroutines.Dispatchers.IO
153153import kotlinx.coroutines.launch
154154import org.json.JSONObject
155+ import java.lang.String.format
155156import java.net.URI
156157import java.net.URLDecoder
157158import java.net.URLEncoder
@@ -180,8 +181,10 @@ open class LoginActivity : FragmentActivity() {
180181 by viewModels { SalesforceSDKManager .getInstance().loginViewModelFactory }
181182
182183 // Webview and Clients
183- protected open val webViewClient = AuthWebViewClient ()
184- protected open val webChromeClient = WebChromeClient ()
184+ @VisibleForTesting(otherwise = PROTECTED )
185+ open val webViewClient = AuthWebViewClient ()
186+ @VisibleForTesting(otherwise = PROTECTED )
187+ open val webChromeClient = WebChromeClient ()
185188 open val webView: WebView by lazy {
186189 WebView (this .baseContext).apply {
187190 layoutParams = ViewGroup .LayoutParams (
@@ -191,9 +194,16 @@ open class LoginActivity : FragmentActivity() {
191194 webViewClient = this @LoginActivity.webViewClient
192195 webChromeClient = this @LoginActivity.webChromeClient
193196 setBackgroundColor(Color .Transparent .toArgb())
194- settings.domStorageEnabled = true /* Salesforce Welcome Discovery requires this */
195- @SuppressLint(" SetJavaScriptEnabled" )
196- settings.javaScriptEnabled = true
197+ settings.apply {
198+ domStorageEnabled = true /* Salesforce Welcome Discovery requires this */
199+ @SuppressLint(" SetJavaScriptEnabled" )
200+ javaScriptEnabled = true
201+ userAgentString = format(
202+ " %s %s" ,
203+ SalesforceSDKManager .getInstance().userAgent,
204+ userAgentString ? : " " ,
205+ )
206+ }
197207 }
198208 }
199209
0 commit comments