Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cometchat avatar

Cometchat Android V6 Production

  • 5 installs
  • 70 repo stars
  • Updated June 23, 2026
  • cometchat/cometchat-skills

Prepares a CometChat v6 Android app for production with token-based auth, ProGuard/R8 configuration, a security checklist, and release-build optimization.

About

This skill covers production readiness for CometChat v6 Android: switching from authKey to token-based authentication, configuring ProGuard/R8, and applying security best practices. A developer uses it when preparing an app for release.

  • Token-based auth replacing the dev authKey
  • ProGuard/R8 config and a security checklist for release builds

Cometchat Android V6 Production by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #828 of 1,039 Mobile Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cometchat/cometchat-skills --skill cometchat-android-v6-production

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
repo stars70
Last updatedJune 23, 2026
Repositorycometchat/cometchat-skills

What it does

Prepares a CometChat v6 Android app for production with token-based auth, ProGuard/R8 configuration, a security checklist, and release-build optimization.

Files

SKILL.mdMarkdownGitHub ↗
Companion skills: cometchat-android-v6-core (init/login), cometchat-android-v6-builder-settings (UIKitSettings), cometchat-android-v6-push (FCM)

Purpose

Prepare a CometChat v6 Android app for production release — switch to token-based auth, configure ProGuard/R8, apply security best practices, and optimize the release build.

Use this skill when

  • Preparing an app for production/release
  • Switching from authKey to token-based authentication
  • Configuring ProGuard/R8 rules for CometChat
  • Reviewing security best practices

Do not use this skill when

  • Setting up for development (use cometchat-android-v6-core)
  • Debugging issues (use cometchat-android-v6-troubleshooting)

1. Token-Based Authentication

1.1 Never Ship authKey

// ❌ NEVER in production
val settings = UIKitSettings.UIKitSettingsBuilder()
    .setAppId("APP_ID")
    .setRegion("us")
    .setAuthKey("AUTH_KEY") // REMOVE THIS
    .build()

CometChatUIKit.login("uid", callback) // Uses authKey internally

// ✅ Production pattern
val settings = UIKitSettings.UIKitSettingsBuilder()
    .setAppId("APP_ID")
    .setRegion("us")
    // No authKey
    .build()

// Get token from your backend server
val authToken = yourServer.getAuthToken(userId)
CometChatUIKit.loginWithAuthToken(authToken, callback)

1.2 Server-Side Token Generation

Your backend generates auth tokens using the CometChat REST API:

  • Endpoint: POST https://{appId}.api-{region}.cometchat.io/v3/users/{uid}/auth_tokens
  • Header: apiKey: YOUR_API_KEY (server-side only)

The auth token is then passed to the client for loginWithAuthToken().

2. ProGuard / R8 Configuration

2.1 Consumer Rules

CometChat UIKit modules include consumer-rules.pro that are automatically applied. Check that your app's build.gradle.kts has:

android {
    buildTypes {
        release {
            isMinifyEnabled = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
}

2.2 Additional ProGuard Rules

If you encounter issues with minification, add these rules:

# CometChat SDK
-keep class com.cometchat.chat.** { *; }
-keep class com.cometchat.calls.** { *; }

# CometChat UIKit
-keep class com.cometchat.uikit.** { *; }

# Gson (used for FCM DTO parsing)
-keep class com.google.gson.** { *; }
-keepattributes Signature
-keepattributes *Annotation*

# Firebase
-keep class com.google.firebase.** { *; }

3. Security Checklist

ItemStatusNotes
Remove authKey from client codeRequiredUse loginWithAuthToken()
Store appId securelyRecommendedUse BuildConfig or encrypted prefs
Use HTTPS for all custom endpointsRequiredoverrideAdminHost / overrideClientHost
Validate auth tokens server-sideRequiredTokens should expire
Do not log sensitive dataRequiredRemove debug logs in release
Enable R8/ProGuardRecommendedObfuscates code
Pin SSL certificatesOptionalFor high-security apps

4. Release Build Configuration

android {
    compileSdk = 36

    defaultConfig {
        minSdk = 28
        targetSdk = 36
    }

    buildTypes {
        release {
            isMinifyEnabled = true
            isShrinkResources = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }

    kotlinOptions {
        jvmTarget = "11"
    }
}

5. Dependency Management

5.1 Compose BOM

For Compose stack, use the BOM to align Compose library versions:

implementation(platform("androidx.compose:compose-bom:2024.x.x"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")

5.2 Version Pinning

Pin CometChat SDK versions explicitly:

implementation("com.cometchat:chatuikit-compose-android:6.0.0-beta2")
// or
implementation("com.cometchat:chatuikit-kotlin-android:6.0.0-beta2")

6. minSdk 28 Implications

v6 requires minSdk = 28 (Android 9.0 Pie). This means:

  • No support for Android 7.0-8.1 devices
  • Full TLS 1.3 support
  • Native BiometricPrompt API available
  • Adaptive icons required

Hard rules

  • NEVER ship authKey in production builds — it allows anyone to create users and login
  • ALWAYS use loginWithAuthToken() with server-generated tokens in production
  • ALWAYS test the release build with ProGuard/R8 enabled before shipping — CometChat uses reflection in some areas
  • minSdk must be 28 — do NOT lower it, v6 APIs depend on API 28+ features
  • Remove all Log.d() / debug logging in release builds — use BuildConfig.DEBUG guards

Related skills

Mobile Developmentappsecsecrets

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.