This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version.The Android UI library helps you use the UI components of the modules and also to design your own custom UIs.




IAMClientSDK.getInstance(this).init(scopes)IAMClientSDK.getInstance(this).handleRedirection(this)val sdk = IAMClientSDK.getInstance(applicationContext)
if (!sdk.isUserSignedIn) {
sdk.presentLoginScreen(this, object : IAMTokenCallback {
override fun onTokenFetchInitiated() {
}
override fun onTokenFetchComplete(zohoToken: IAMToken) {
//<This method will be called after user logged-in successfully>
}
override fun onTokenFetchFailed(zohoErrorCodes: IAMErrorCodes) {
//<This method will be called if any error occurred in the login. You will receive the error code in this callback.>
}
}, null)
} else {
// start intent to your first activity
}class ZCAuthImpl(private val context: Context) : ZCOauthHelper {
@Throws(ZCException::class)
override suspend fun getAccessToken(): String? {
return suspendCoroutine { continuation ->
IAMClientSDK.getInstance(context).getToken(object : IAMTokenCallback {
override fun onTokenFetchInitiated() {
}
override fun onTokenFetchComplete(token: IAMToken) {
continuation.resumeWith(Result.success(token.token))
}
override fun onTokenFetchFailed(errorCode: IAMErrorCodes) {
continuation.resumeWith(Result.success(null))
}
})
}
}
override fun getInitialScopes(context: Context): String {
return ""
}
override fun isUserSignedIn(): Boolean {
return IAMClientSDK.getInstance(context).isUserSignedIn
}
override fun getUserData(): Any? {
return null
}
override fun getTransformedUrl(url: String): String {
return url
}
override fun checkAndLogout(): Boolean {
return false
}
override fun isEnhanceTokenNeeded(newScopes: String): Boolean {
return false
}
override fun enhanceToken(tokenHelper: ZCOauthHelper.ZCOAuthTokenHelper, newScopes: String) {
}
override fun enhanceTokenWithOnDemandScope(tokenHelper: ZCOauthHelper.ZCOAuthTokenHelper) {
}
}ZCAPIUtil.setOAuthHelper(ZCAuthImpl(applicationContext))