please select
  • UIKit
  • SDK
  • Server APIs
Chat/
UIKit/
iOS and macOS/
Features/
UIKit
  • Overview
  • Run Demo
  • Getting Started
  • Installation
    • TUIKit
    • TUIChat Only
  • Build Basic Interfaces
    • Chat
    • Conversation List
    • Contact List
    • Add Contact
    • Create Group Chat
    • Video and Audio Call
  • Features
    • Reactions
    • Quote
    • Read Receipt
    • User Online Status
    • Translation
    • Voice to Text
    • Search Messages
  • Customization
    • Customize Messages
    • Customize Emojis and Stickers
  • Localization
  • Changelog
  • Guideline for Beginners
  • Console Guide
    • Creating and Upgrading an Application
    • Basic Configuration
    • Feature Configuration
    • Account Management
    • Group Management
    • Webhook Configuration
  • Product Introduction
    • Message Management
      • One-to-One Message
      • Message Storage
      • Offline Push
      • Group Message
      • Message Formats
    • Account System
      • Login Authentication
      • Online Status Management
    • Group Related
      • Group System
      • Group Management
    • User Profile and Relationship Chain
      • Profile Management
      • Relationship Chain Management
  • Purchase Guide
    • Billing Overview
    • Pricing
  • Error Codes

User Online Status

Description

TUIKit supports displaying user online status starting from version 6.5.2803.
When "Show User Online Status" is enabled, user online status will be displayed on each user's avatar in the chat list and contact list. A green circle indicates online; absence of the green circle indicates offline.
When "Show User Online Status" is disabled, user online status will not be displayed.
Note:
The "User Online Status" feature is only supported by the premium edition. Please make sure that the premium package is activated before using this feature.
The "User Online Status" feature requires turning on the user status switch in the Chat console. Please make sure that the switch is turned on before using this feature.

Enabling User Online Status

In the TUICore component, within the TUIConfig file, a switch for the "User Online Status" feature, named displayOnlineStatusIcon, is provided. Its type is BOOL, with the default value of NO.
- (id)init
{
self = [super init];
if(self){
//...Other configurations
self.displayOnlineStatusIcon = NO;
}
return self;
}
To enable the chat list to display user online status, first subscribe to the premium package, then turn on the user status feature switch in the Chat console, and change the default value of displayOnlineStatusIcon to YES, or call the following method before initializing the chat page.
[TUIConfig defaultConfig].displayOnlineStatusIcon = YES;

Display Effect

Chat List

Enabling "Show User Online Status"
Disabling "Show User Online Status"



Contacts List

Enabling "Show User Online Status"
Disabling "Show User Online Status"



FAQs

When the Subscription/Unsubscription API is called, the API returns error code "72001".
Error code 72001 indicates that the corresponding capability has not been activated in the console. Please log in to the Chat console and enable the corresponding feature switch.

Error: The package does not support the use of this API, please upgrade to the premium package.
The "User Online Status" feature is only supported by the premium package. This error message indicates that your current package does not support this feature. Please log in to the Chat purchase page to activate the premium package and experience it.

Exchange and Feedback

Join the Telegram technical exchange group or WhatsApp discussion group, benefit from the support of professional engineers, and solve your toughest challenges.