Read-Only Mode
Applying the Read-Only Mode
The read-only mode restricts user interaction within the chat but allows them to read messages while all interface controls are disabled for interaction. Below is a detailed guide on configuring and using this mode effectively.
Possible Values
true
When set to true, the chat enters read-only mode.
Users can:
- Read messages
- Navigate to the latest messages (using the arrow button in the interface).
Users cannot:
- Send messages.
- React to messages.
- Interact with any other chat elements.
false
When set to false or omitted, the chat operates in its default interactive mode, allowing users to do any actions.
Additional Considerations for Non-Authorised Zones
In scenarios where users are accessing the chat in a non-authorized zone (e.g., as guests), it is essential to ensure that a unique userID is still provided to facilitate proper tracking and interaction handling. Even in read-only mode, assigning a unique identifier helps maintain user session integrity and enables accurate engagement analytics.
Read-only Interaction Tracking
User Interaction Events in Read-Only Mode
In read-only mode, user interactions are limited, but tracking engagement through a mechanism that notifies the main platform of user actions is still essential. This allows for implementing necessary scenarios, such as triggering user authorization.
Key Points on User Actions:
- Excluded Actions:
- Accepting chat rules (pop-up)
- Interacting with a welcome message (pop-up)
These actions do not trigger a notification event.
- Tracked Actions:
Any other interaction attempts within the chat will dispatch an event to the parent window.
Event Notification Mechanism
When a user attempts to interact with the chat in read-only mode (excluding the excluded actions), an event is sent to the parent window via the postMessage
API.
Event Details:
Type: watchersAttemptClick
Purpose: To notify the parent application of user interaction attempts within the read-only chat.
Example Implementation of Event Handling
The parent application can handle these events using an event listener. Below is an example of how to implement this functionality:
window.addEventListener('message', (event) => { if (event.data.type === 'watchersAttemptClick') { // Handle the user interaction event console.log('User interaction detected in read-only chat.'); } });
How to Use Read-Only Mode for Controlled Chat Access
In modern web applications, ensuring that users have the appropriate level of access is crucial for maintaining security and a positive user experience. One effective strategy is to utilize a read-only mode that dynamically adjusts chat functionality based on user-specific criteria.
Criteria for Full Chat Access
The platform’s front end verifies whether users meet the necessary conditions before granting full chat access. For example, full access is granted only to users who have:
- Made a Deposit: A financial commitment indicates a user’s seriousness and engagement.
- Possess a Betting History: A record of betting activity demonstrates experience and trustworthiness.
Users who satisfy these (or any other conditions) gain full access, allowing them to send messages, interact with others, and fully engage with the community. This approach helps foster a secure and vibrant environment where participation is based on proven commitment.
Implementation of Read-Only Mode
Users who do not meet the established criteria are placed in read-only mode. In this mode, they can view all chat content but are restricted from sending messages or interacting with the chat. This method provides several benefits:
- Enhanced Security: Limiting interactive capabilities for non-verified users reduces spam and malicious content risks.
- Controlled User Experience: Read-only mode offers a preview of the chat experience, motivating users to meet the criteria for full access.
- Scalability: As the user base grows, the system protects the chat environment from unauthorized interactions.
Monitoring and Notification of Interaction Attempts
A key feature of read-only mode is its ability to detect and respond to user interaction attempts. When a user in read-only mode tries to engage with the chat interface, the system registers the action. It sends a notification to the parent window—typically the partner platform. This mechanism enables real-time tracking of unauthorized interactions and allows the partner to respond proactively.
With these notifications, the platform can deploy various strategies. For example, it can display alerts prompting users to take specific actions to earn full chat access. The system can automatically trigger an authorisation process for users who are not yet authenticated, streamlining their transition to full access.
Conclusion
Implementing a read-only mode based on user-specific criteria is a strategic approach to managing chat access securely and effectively. By granting full interactive capabilities only to users who demonstrate commitment—through actions like making a deposit or maintaining a betting history—and restricting others to a read-only experience, you can enhance security, streamline the user experience, collect valuable interaction data, and stimulate users to authorise on the platform. Additionally, real-time notifications to the partner platform ensure prompt responses to interaction attempts, further reinforcing the system’s integrity and encouraging users to upgrade their access.
Updated 9 days ago