DChat Front-end Communication Permission Demonstration 2

Release time:2026-06-25     Source:傲然技术     Views: 22

Demonstration video link: https://kunshanhtk.oss-cn-shanghai.aliyuncs.com/upload/4a0a82ffd01ad91cdf8e857781c6e25f.mp4


DChat is an end-to-end encrypted instant messaging application. After logging in, the app runs the KeepAliveService foreground service in the background, maintaining a connection with the server via WebSocket to synonize the following data:
New message arrival signaling and delivery status
Friend/Group Online Status Change
Handshake signaling required for establishing a P2P encrypted session
Connection reestablishment and offline message retri after network recovery
This service only starts when the user actively logs in and ends upon logout or service termination. During operation, it displays a low-priority persistent notification in the notification bar (e.g., "DChat Connected"), which the user can tap to return to the app.
User-initiated method:
By logging into an account, the user agrees to receive instant messages continuously. The service will automatically stop after logging out.
Impact of task delays or interruptions by the system:
If the foreground service is delayed or interrupted by the system, users may not receive new message notifications promptly, online status s may be delayed, and P2P connections with end-to-end encryption may require waiting for the service to return to the foreground or be woken up by a push notification. This does not affect the local storage of messages already sent.
Relationship with Push:
When the process is reclaimed by the system, it is woken up and reconnected via EngageLab. The foreground service is used to maintain real-time IM signaling synonization when the user is logged in and the app is in the background. These two work together, with the foreground service not being utilized for ads or unrelated background tasks.