This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version.


Note: The Android app must have a minimum SDK version 22 or higher.ZohoSDK.getInstance(this).init(scopes, showlogs)
ZohoSDK.getInstance(this).handleRedirection(this);
val sdk = ZohoSDK.getInstance(applicationContext) if (!sdk.isUserSignedIn) { sdk.presentLoginScreen(this, object : ZohoTokenCallback { override fun onTokenFetchInitiated() { } override fun onTokenFetchComplete(zohoToken: ZohoToken?) { // This method will be called after user logged-in successfully } override fun onTokenFetchFailed(zohoErrorCodes: ZohoErrorCodes?) { // 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 ZohoSDK.getInstance(context).token.token
}
override fun getInitialScopes(context: Context): String {
return ""
}
override fun isUserSignedIn(): Boolean {
return ZohoSDK.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))