Page updated Nov 3, 2023

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 of isSignInComplete
  • confirmResetPassword API takes additional username parameter.
  • signOut now takes single onComplete parameter instead of onSuccess and onError.
  • fetchAuthSession now returns identityIdResult instead of identityId.
  • getCurrentUser API is now asynchronous and requires onSuccess and onError parameters. AuthUser is returned in onSuccess
1Amplify.Auth.getCurrentUser({ authUser ->
2 Log.i("MyAmplifyApp", "Current User is $authUser")
3}, { exception ->
4 Log.e("MyAmplifyApp", "Error getting current user", exception)
5})
  • The escape hatch now provides access to the underlying CognitoIdentityProviderClient and CognitoIdentityClient instance. Read more here.
  • Parameters signInQueryParameters, signOutQueryParameters, and tokenQueryParameters are dropped from AuthWebUISignInOptions.
  • federationProviderName has been dropped from AWSCognitoAuthWebUISignInOptions.
  • 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: