Login UI

TerraCore v0

This is the built-in UI that will display login methods, configurabled from server side, for you to integrate the features quickly

Installation#

implement("vn.teko.android.auth:login-ui:$version")

This UI uses Apollo Components so you will also need to configure Apollo before.

Enable login methods in Terra Console#

Please contact us we will setup it for you.

  • If you use Facebook login method, you will need to create a Facebook app then give us the Facebook AppID
  • If you use Google login method, you will need to create client then give us the Google ClientID
  • If you use Apple login method, you will need to create app id then give us the Apple AppID

Usage#

Inside a Fragment or Activity, call this function to open Login UI

TerraAuthUI.getInstance(terraApp).startLogin(this)

Handle Login Result

override fun onActivityResult(
requestCode: Int,
resultCode: Int,
data: Intent?
) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == TerraAuthUI.LOGIN_UI_REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
// handle successful login
} else {
// handle failed login
}
}
}