Skip to main content

Integrate vivo Push

Follow this guide to integrate the vivo Push Client. RC SDK supports receiving push notifications from vivo Push Service.

Before integrating third-party push, ensure that the Android Application ID has been configured in the Console. For details, refer to Push Integration Overview.

Configure vivo Push in the Console

To receive push notifications from RC IM service via vivo Push, you need to provide the details of your vivo Push application in the Console.

  1. Go to the vivo Developer Platform - Push Server Platform and record the AppID, AppKey, and AppSecret of your vivo application.

    tip

    If you don’t have a vivo developer account or haven’t created an application yet, refer to the vivo documentation vivo Push Access Process.

    (width=600)

    (height=400)

  2. Open the Console, click Set Push on the Application Identifier page, locate Android > vivo Push, and enter the AppID, AppKey, and AppSecret obtained in the previous step.

    (height=400)

  3. (Optional) Configure the Push Notification Title. Set the default push notification title. Generally, this title setting is not used when the client sends a message converted to Push. When calling the RC server API /push.json, /push/user.json, /push/custom.json to send push notifications, if the notification title is not passed, the title set here will be used. When sending a message from the server, if the sender's user ID does not have a username in the RC server, this "Push Notification Title" will also be used.

  4. Configure the Push Mode. For the difference between formal push and test push, refer to the vivo documentation vivo Push User Guide.

  5. (Optional) Configure the Push Channel Type and Category (secondary message classification). If no value is passed when sending a message or push notification via the client or server API, the value configured here will be used by default. Refer to the vivo documentation Push Message Classification Instructions for configuration.

  6. Save the settings. All settings will take effect after 30 minutes.

You have completed all the necessary vivo push configurations in the Console. Now you can proceed to set up client integration.

Configure the Client to Receive vivo Push

Add dependencies in the App’s build.gradle and configure vivo’s VIVO_APP_ID and VIVO_APP_KEY.

android {
defaultConfig {
//...
manifestPlaceholders = [
VIVO_APP_ID : "xxxxxxxxxx",
VIVO_APP_KEY: "xxxxxxxxxx"
]
}
}
dependencies {
// x.y.z is the current IM SDK version number
implementation 'cn.rongcloud.sdk.push:vivo:x.y.z'
}

Enable vivo Push Service

Before initializing the SDK, call the following code to initialize the RongPushPlugin module.

RongPushPlugin.init(getContext());

If the RongPushPlugin module cannot be found, check if you have integrated the RC self-built push channel.

Obfuscation Configuration

Add the following instructions in the obfuscation file to prevent the SDK content from being obfuscated again. Custom callback classes must not be obfuscated.

-dontwarn com.vivo.push.**
-keep class com.vivo.push.**{*; }
-keep class com.vivo.vms.**{*; }
-keep class xxx.xxx.xxx.PushMessageReceiverImpl{*;}

Handle Push Notification Click Events

  • Customize Push Notification Click Events: Learn how to implement the SDK’s default jump behavior and how to customize the handling of click events. For details, refer to Customize Push Notification Click Events.

  • Customize Push Notification Styles: When the SDK receives push notifications from other third-party vendors, the notifications are system notifications directly popped up by the underlying mobile system, so customization is not supported.