Check the following items to troubleshoot failed push messages:
- The software development kit (SDK) must be successfully initialized to receive push messages.
- The push system only delivers messages. You must process the message data and display it as needed. For an example of how to process messages, see the official demo.
- To listen for incoming messages, register a broadcast listener for the
CCPDidReceiveMessageNotificationevent in the notification center. For more information, see iOS API introduction. - The iOS message channel is active only when the app is in the
foreground. When the app switches to the background, the message channel disconnects. This means the app must be in the foreground to receive push messages. - When the message channel is disconnected (when the app is in the background or closed):
- If offline message storage is not configured on the server-side, messages cannot be received when the channel reconnects.
- If offline message storage is configured on the server-side, check the time-to-live (TTL) setting. For more information, see Can messages sent while an app is not in the foreground be retrieved after the app enters the foreground and establishes a channel?
- Check the phone's network configuration. If the SDK version is earlier than v1.7.2, see How to resolve the "route not found" error after switching the appKey on iOS.
该文章对您有帮助吗?