Skip to main content

Integrate OPPO Push Notifications

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

tip
  • Not all OPPO phones support OPPO Push. OPPO Push currently supports OPPO models with ColorOS 3.1 and above, OnePlus 5/5t and above, and all realme models. For details, refer to the OPPO Push Service documentation Business Function Usage Issues.
  • On OPPO phones that do not support OPPO Push, RC's default push service will be used.

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

Configure OPPO Push in the RC Console

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

  1. Go to the OPPO Push Operation Platform and navigate to Configuration Management > Application Configuration to obtain the push credentials, including AppKey, AppSecret, and MasterSecret.

    tip
    • If you do not have an OPPO developer account, or have not created an application, or have not enabled the push service permission, please first create an account, application, and enable the push service permission on the OPPO Developer Platform. For details, refer to the OPPO Developer documentation Push Service Activation Guide.
    • OPPO requires registering as an OPPO enterprise developer to enable the push service. For details, refer to OPPO Enterprise Developer Account Registration Process.

    (width=600)

    The OPPO push credentials are used as follows:

    • AppKey: The identity of the OPPO application. It is required for both the client and the RC Console when configuring OPPO Push.
    • AppSecret: Used when integrating the OPPO Push SDK into the client.
    • MasterSecret (i.e., AppServerSecret): Used when configuring the OPPO Push service credentials in the RC Console.
  2. Open the RC Console, go to the Application Identifier page, click Set Push, and find Android > OPPO Push. Enter the App Key and Master Secret obtained in the previous step.

    (height=400)

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

  4. Configure the Push Channel Type. The OPPO official developer documentation states: To improve the notification experience for end users and create a sustainable push ecosystem, OPPO Push has imposed a limit on the number of push messages each APP can send. However, for instant messaging/system reminder push needs, you can apply for a private message channel (this channel has no limit on the number of push messages).

    tip

    The RC server uses the OPPO public push channel by default, which has a daily limit on the number of push messages. Once the total number of push messages is used up, no more push content can be sent to users that day. Currently, the daily push limit is: cumulative registered users * 2. If you need to use the private message push channel, which has no limit on the number of push messages, refer to the OPPO documentation Private Message Push Channel Application. After applying for the private message channel, return to the RC Console and enter the private message push channel's channel Id.

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

You have now completed all the necessary OPPO Push configurations in the RC Console. You can now proceed to set up client integration.

Configure the Client to Receive OPPO Push

Add dependencies in the App's build.gradle and configure the OPPO_APP_KEY and OPPO_APP_SECRET for OPPO.

android {
defaultConfig {
//...
manifestPlaceholders = [
OPPO_APP_KEY : "xxxxxxxx",
OPPO_APP_SECRET: "xxxxxxxx"
]
}
}
dependencies {
// x.y.z is the current IM SDK version number
implementation 'cn.rongcloud.sdk.push:oppo:x.y.z'
}

For a description of the permission requirements, refer to the OPPO official developer documentation SDK Data Security Description.

Enable OPPO 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 already integrated RC's built-in push channel.

Obfuscation Configuration

If your application uses obfuscation, you can use the following obfuscation configuration:

-keep public class * extends android.app.Service
-keep class com.heytap.msp.** { *;}

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, which are directly popped up by the underlying system of the phone. Therefore, customization is not supported.

Frequently Asked Questions

Receiving OPPO Push requires the user's OPPO phone to have the application's notification permissions enabled. Since RC Push is an application-level push service, it is subject to various system permission restrictions. We recommend that you enable the auto-start permission and notification permission in the settings, or check "Trust this application" to improve the push delivery rate.

OPPO Push currently only supports push notifications in the notification bar. Messages are delivered to the OS system module and displayed by the system notification module. The application is not launched until the user clicks the notification.

Since not all OPPO phones support OPPO Push, OPPO Push is only used on OPPO phones that support it. On OPPO phones that do not support OPPO Push, RC's default push service is used.

For other issues related to the OPPO Push service, refer to the OPPO official developer documentation "Frequently Asked Questions" Technical Issues and Business Function Usage Issues.