please select
  • UIKit
  • SDK
  • Server APIs
Chat/
All_Platform/
Product Introduction/
Message Management/
All_Platform
  • 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

Offline Push

Application Scenarios

You can use the offline push feature to allow users to receive new messages even when the app is running in the background or the process has been killed. iOS devices use APNs for offline push, while Android devices need you to register for offline message callbacks.

iOS APNs Push Notifications

Push notification format


The figure shows the examples of a one-to-one chat message and group chat message. For more information about iOS APNs push formats, see Push Format.

Basic APIs

The following APIs must be called to support APNs. For more information, see iOS APNs Event Reporting:
Set the token.
Switch to the background and report unread messages.
Switch to the foreground and push notifications.

Setting the Ext extension field

In some cases, an app needs to set the Ext extension field for offline push based on specific circumstances to facilitate user operations such as redirect clicks. You can input it into the Ext field in TIMCustomElem, and during push, the IM backend will input the field into Ext. For more information, see Customizing Offline Message Attributes to customize the extension field.

Setting push alert sounds

In some cases, an app needs to set the push alert sound of a single message to alert users. You can input the sound into the sound field in TIMCustomElem, and during push, the IM backend will input the field into Ext. For more information, see Setting Custom Push Alert Sounds.

Android Offline Push

Android 1.8.0 and later versions support separating services from processes. When the app process is killed, the service survives and continues to receive offline notifications. For more information, see Android Offline Push.

Sending Messages from the Backend

For iOS, you can refer to Push Format to set the display format of APNs push messages; for Android, you can refer to OfflinePushInfo to set the display format.

References