Skip to main content

Resolving Push Client Conflicts

This document describes how to avoid or resolve potential push client conflicts in your application.

Push client conflicts may occur in the following scenarios:

  • Your application has already integrated a third-party push client, which conflicts with the third-party vendor push client SDK required by RC's push service
  • Other SDKs integrated in your application include third-party push clients that conflict with the vendor push client SDK required by RC's push service

If any of the above situations exist, you can choose whether to use RC's push client integration solution.

Discontinuing RC's Push Client Integration Solution

To discontinue using RC's push client integration solution, follow these steps:

  1. Complete third-party push configuration in the Console by referring to the push client integration documentation.

  2. Before initializing the SDK, you must create a PushConfig, enable push channels for the vendors you use, and provide the configuration to RongPushClient.

    PushConfig config = new PushConfig.Builder()
    .enableFCM(true)
    .enableHWPush(true)
    .enableVivoPush(true)
    .enableMiPush("Xiaomi appId", "Xiaomi appKey") //Xiaomi push configuration
    .enableMeiZuPush("Meizu appId", "Meizu appKey") // Meizu push configuration
    .enableOppoPush("OPPO_App_KEY", "OPPO_App_Secret") // OPPO push configuration
    .build();
    RongPushClient.setPushConfig(config); //Set push configuration to SDK
  3. Obtain vendor tokens from the third-party push SDK. Refer to the third-party push SDK documentation for specific methods.

  4. Since RongPushClient executes asynchronously during SDK initialization and currently doesn't provide initialization completion notifications, we recommend delaying for approximately 3 seconds before calling the onReceiveToken method to report the third-party push token to RC. Otherwise, the SDK cannot properly report push-related statistics.

    PushManager.getInstance().onReceiveToken(context,pushType,token);
  5. Check logs to verify successful reporting by searching for the keyword L-push-config-report-token-R. A "report token success" message indicates successful integration.

Continuing with RC's Push Client Integration Solution

If you wish to continue using the push client integration solution, you can remove the push SDK integrated in your application and obtain vendor push tokens from RC IM SDK callbacks, then report them to third-party push vendors or integrators.

You can set a PushEventListener in the Application's onCreate method and obtain vendor push tokens through the onTokenReceived(PushType pushType, String token); callback method.

RongPushClient.setPushEventListener(
new PushEventListener() {

@Override
public void onTokenReceived(
PushType pushType,
String token) {
}

/// Other methods omitted here

});