In Mobile SDK 13.0, we redesigned the login experience on Android. The redesign features a modernized architecture that uses Jetpack Compose and Model-View-ViewModel (MVVM).
Starting in 13.0, you can customize your app’s login screen in LoginViewModel
without overriding LoginActivity
. If your app makes extensive customizations to LoginActivity
, see Breaking Code Changes to adapt your work.
In our redesign of the Android login experience, we made these breaking code changes. The values and functions from these classes have been moved, updated, or removed.
We removed OAuthWebviewHelper
in 13.0.
val authorizationDisplayType
moved toLoginViewModel
.val loginUrl
moved toLoginViewModel
.fun clearCookies()
moved toLoginViewModel
.inner class AuthWebViewClient : WebViewClient()
moved toLoginActivity
.fun buildAccountName(username: String?, instanceServer: String?)
moved toLoginViewModel
.
val oAuthClientId/getOAuthClientId()
was updated. Set or overridevar clientId
inLoginViewModel
.fun makeWebChromeClient()
was updated. Overrideval webChromeClient
inLoginActivity
.fun makeWebViewClient()
was updated. Overrideval webViewClient
inLoginActivity
.fun onAuthFlowComplete(tr: OAuth2.TokenEndpointResponse?, nativeLogin: Boolean)
was updated. Use theonAuthFlowSuccess(userAccount: UserAccount)
function inLoginActivity
.
fun getAuthorizationUrl(useWebServerAuthentication: Boolean, useHybridAuthentication: Boolean)
We removed OAuthWebviewHelperEvents
in 13.0.
fun loadingLoginPage(loginUrl: String)
was updated. Observe changes in the view model’sloginUrl
orselectedServer
.fun finish(userAccount: UserAccount?)
was updated. UseonAuthFlowSuccess(userAccount: UserAccount)
inLoginActivity
instead.
fun onAccountAuthenticatorResult(authResult: Bundle)
fun onClearCookiesClick(v: View?)
is now handled in Compose. OverrideclearCookies()
in the view model instead.findViewById<WebView>
was updated. Modify or overrideval webView: WebView
inLoginActivity
.actionBar/supportActionBar
was updated. Customize values likevar titleText: String?
andvar topBarColor: Color?
in the view model.
fun getOAuthWebviewHelper(...)
fun onPickServerClick(v: View?)