plugin that handle amplify features
npm install @falconeta/capacitor-aws-amplify
npx cap sync
Inside MainActivity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
.
.
.
if (data == null){
Amplify.Auth.handleWebUISignInResponse(null);
}
}
Inside gradle
// Amplify core dependency
implementation 'com.amplifyframework:core:1.38.7'
// AWS Cognito dependency
implementation 'com.amplifyframework:aws-auth-cognito:1.38.7'
load(...)
signIn(...)
federatedSignIn(...)
fetchAuthSession()
getUserAttributes()
updateUserAttributes(...)
signOut()
deleteUser()
- Interfaces
- Type Aliases
- Enums
load(options: { cognitoConfig: AWSCognitoConfig; }) => Promise<void>
Param | Type |
---|---|
options |
{ cognitoConfig: AWSCognitoConfig; } |
signIn(options: { email: string; password: string; }) => Promise<CognitoAuthSession>
Param | Type |
---|---|
options |
{ email: string; password: string; } |
Returns: Promise<CognitoAuthSession>
federatedSignIn(options: { provider: CognitoHostedUIIdentityProvider; }) => Promise<CognitoAuthSession>
Param | Type |
---|---|
options |
{ provider: CognitoHostedUIIdentityProvider; } |
Returns: Promise<CognitoAuthSession>
fetchAuthSession() => Promise<CognitoAuthSession>
Returns: Promise<CognitoAuthSession>
getUserAttributes() => Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
updateUserAttributes(options: { attributes: { name: AuthUserAttributeKey | string; value: string; }[]; }) => Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
Param | Type |
---|---|
options |
{ attributes: { name: string; value: string; }[]; } |
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
signOut() => Promise<{ status: AwsAmplifyPluginResponseStatus; }>
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; }>
deleteUser() => Promise<{ status: AwsAmplifyPluginResponseStatus; }>
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; }>
Prop | Type |
---|---|
aws_cognito_region |
string |
aws_user_pools_id |
string |
aws_user_pools_web_client_id |
string |
aws_cognito_identity_pool_id |
string |
aws_mandatory_sign_in |
string |
oauth |
{ domain: string; scope: string[]; redirectSignIn: string; redirectSignOut: string; responseType: 'code'; } |
Prop | Type |
---|---|
accessToken |
string |
idToken |
string |
identityId |
string |
refreshToken |
string |
deviceKey |
string | null |
status |
AwsAmplifyPluginResponseStatus |
Construct a type with a set of properties K of type T
{
[P in K]: T;
}
Members | Value |
---|---|
Ok |
0 |
Ko |
-1 |
Cancelled |
-2 |
SignedOut |
-3 |
Members | Value |
---|---|
Cognito |
'COGNITO' |
Google |
'Google' |
Facebook |
'Facebook' |
Amazon |
'LoginWithAmazon' |
Apple |
'SignInWithApple' |
Members | Value |
---|---|
address |
'address' |
birthDate |
'birthDate' |
email |
'email' |
familyName |
'familyName' |
gender |
'gender' |
givenName |
'givenName' |
locale |
'locale' |
middleName |
'middleName' |
name |
'name' |
nickname |
'nickname' |
phoneNumber |
'phoneNumber' |
picture |
'picture' |
preferredUsername |
'preferredUsername' |