Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Drop-in auth

You are currently viewing the AWS SDK for Mobile documentation which is a collection of low-level libraries. Use the Amplify libraries for all new app development. Learn more

You can view the Mobile SDK API reference here.

The AWSMobileClient client supports a "drop-in" UI component that allows you to easily add the full capabilities for authentication to your application.

AWSMobileClient.default().showSignIn(
navigationController: self.navigationController!, { (signInState, error) in
if let signInState = signInState {
print("Sign in flow completed: \(signInState)")
} else if let error = error {
print("error logging in: \(error.localizedDescription)")
}
}
)

Note: The drop-in UI requires the use of a navigation controller. Please make sure your app has an active navigation controller which is passed in via the navigationController parameter.

Customization

You can change the following properties of the drop-in UI with the AWSMobileClient:

  • Logo: Any image file of png or jpg
  • Background Color: Any iOS UIColor
AWSMobileClient.default()
.showSignIn(
navigationController: self.navigationController!,
signInUIOptions: SignInUIOptions(
// dismiss the sign-in process
canCancel: false,
logoImage: UIImage(
named: "MyCustomLogo"
),
backgroundColor: UIColor.black
)
) { (result, err) in
//handle results and errors
}