Upgrade guide
The latest version (v2) of Amplify Library for Android supports Android SDK API 24: Android 7.0 (Nougat) and higher. Amplify Library for Android is layered on the AWS SDK for Kotlin. This allows for access to the AWS SDK for Kotlin for a breadth of service-centric APIs.
In addition to the underlying SDK changes, the following are the API changes you will notice from v1 to v2:
Auth
- signIn now returns result with
isSignedIn
instead ofisSignInComplete
- confirmResetPassword API takes additional
username
parameter. - signOut now takes single
onComplete
parameter instead ofonSuccess
andonError
. - fetchAuthSession now returns
identityIdResult
instead ofidentityId
. getCurrentUser
API is now asynchronous and requiresonSuccess
andonError
parameters.AuthUser
is returned inonSuccess
Amplify.Auth.getCurrentUser({ authUser -> Log.i("MyAmplifyApp", "Current User is $authUser")}, { exception -> Log.e("MyAmplifyApp", "Error getting current user", exception)})
- The escape hatch now provides access to the underlying
CognitoIdentityProviderClient
andCognitoIdentityClient
instance. Read more here. - Parameters
signInQueryParameters
,signOutQueryParameters
, andtokenQueryParameters
are dropped fromAuthWebUISignInOptions
. federationProviderName
has been dropped fromAWSCognitoAuthWebUISignInOptions
.signIn
will now return an error if you attempt to call sign in, while already signed in.
Escape Hatches
With the latest version of Amplify Library for Android, you now have access to the AWS SDK for Kotlin. Please follow the guidelines under the respective categories to access its escape hatch: