Skip to content

Commit f89f06b

Browse files
committed
Fix missing webview user agent.
1 parent c3dbc57 commit f89f06b

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ import kotlinx.coroutines.Dispatchers.Default
152152
import kotlinx.coroutines.Dispatchers.IO
153153
import kotlinx.coroutines.launch
154154
import org.json.JSONObject
155+
import java.lang.String.format
155156
import java.net.URI
156157
import java.net.URLDecoder
157158
import java.net.URLEncoder
@@ -191,9 +192,16 @@ open class LoginActivity : FragmentActivity() {
191192
webViewClient = this@LoginActivity.webViewClient
192193
webChromeClient = this@LoginActivity.webChromeClient
193194
setBackgroundColor(Color.Transparent.toArgb())
194-
settings.domStorageEnabled = true /* Salesforce Welcome Discovery requires this */
195-
@SuppressLint("SetJavaScriptEnabled")
196-
settings.javaScriptEnabled = true
195+
settings.apply {
196+
domStorageEnabled = true /* Salesforce Welcome Discovery requires this */
197+
@SuppressLint("SetJavaScriptEnabled")
198+
javaScriptEnabled = true
199+
userAgentString = format(
200+
"%s %s",
201+
SalesforceSDKManager.getInstance().userAgent,
202+
userAgentString ?: "",
203+
)
204+
}
197205
}
198206
}
199207

0 commit comments

Comments
 (0)