Skip to main content
UIKit automatically adapts its interface and behaviour when a visitor or bot session is active. This guide covers the UIKit-specific layer on top of SDK visitor mode.
Prerequisites: Visitor mode must be enabled for your network and the SDK must be logged in as a visitor before UIKit renders. See SDK Visitor Mode for login setup.

Tab Visibility

UIKit adjusts which tabs are visible based on user type. Visitors see a read-only subset of the navigation:
TabVisitorSigned-In
Communities / Explore✅ Visible (default)✅ Visible
Events✅ Visible✅ Visible
ClipsConfigurable (can_view_tab)✅ Visible
Newsfeed / Following❌ Hidden✅ Visible
// config.json — control Clips tab visibility for visitors
{
  "feature_flags": {
    "post": {
      "clip": {
        "can_view_tab": "all"           // show to visitors
        // "can_view_tab": "signed_in_user_only"  // hide from visitors (default)
      }
    }
  }
}

Restricted Action Handling

When a visitor attempts a write action (react, comment, reply, follow), UIKit shows a sign-in prompt by default. Override handleVisitorUserAction in AmityGlobalBehavior to navigate to your own sign-in screen instead.
AmityUIKit4Manager.behavior.globalBehavior = MyGlobalBehavior()

class MyGlobalBehavior: AmityGlobalBehavior {
    override func handleGuestUserAction(context: Context?) {
        // Default: show sign-in toast
        // Override: navigate to your sign-in screen
        MyAuthFlow.presentSignIn()
    }
}

Daily Usage Limit Page

When a visitor exceeds their 100 read requests/day quota, the backend returns error 400323. UIKit automatically subscribes to the SDK’s visitorUsageLimitReached event and shows a full-screen VisitorUsageLimitPage that blocks further navigation until the user signs in.

Default Page

Back gestures and the system back button are disabled while the page is shown:
  • Web: Navigation stack unmounted at root
  • Android: Activity back stack cleared, back press swallowed
  • iOS: Presented modally, swipe-back disabled

Platform Availability

PlatformUIKit VersionNotes
Android4.18.0+AmityGlobalBehavior overrides available
iOS4.22.0+AmityGlobalBehavior overrides available
Web4.17.0+AmityGlobalBehavior overrides available

Customizing the Error Page

Use two new AmityGlobalBehavior handlers to replace the default experience:
HandlerDefault behaviourOverride use case
handleVisitorUsageLimitReachedShow VisitorUsageLimitPage full-screenShow your own branded error UI
handleVisitorUsageLimitSignInShow toast: “Create an account or sign in to continue.”Navigate to your own sign-in screen
class MyGlobalBehavior: AmityGlobalBehavior {

    // Replace the full-page error with your own UI
    override func handleVisitorUsageLimitReached() {
        MyAuthFlow.presentVisitorLimitError()
    }

    // Replace the "Sign in" CTA action
    override func handleVisitorUsageLimitSignIn() {
        MyAuthFlow.presentSignIn()
    }
}

AmityUIKit4Manager.behavior.globalBehavior = MyGlobalBehavior()
The usage limit state is in-memory only. It resets automatically when the app restarts or when registerDevice() is called with a signed-in userId. Never persist the state to local storage — this ensures users see the normal UI again after signing in or after the daily quota resets.

SDK Visitor Mode

Visitor login, device fingerprinting, secure mode, and SDK error codes

Error Handling

Full server error reference including 400323, 403999, 403998