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
isSignedIninstead ofisSignInComplete - confirmResetPassword API takes additional
usernameparameter. - signOut now takes single
onCompleteparameter instead ofonSuccessandonError. - fetchAuthSession now returns
identityIdResultinstead ofidentityId. getCurrentUserAPI is now asynchronous and requiresonSuccessandonErrorparameters.AuthUseris 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
CognitoIdentityProviderClientandCognitoIdentityClientinstance. Read more here. - Parameters
signInQueryParameters,signOutQueryParameters, andtokenQueryParametersare dropped fromAuthWebUISignInOptions. federationProviderNamehas been dropped fromAWSCognitoAuthWebUISignInOptions.signInwill 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: