Getting Started with Push Notification 2.0 Integration
The RC Push 2.0 integration solution (requires IMLib SDK ≧ 5.6.0) encapsulates third-party vendor push channel SDKs as plugins, facilitating rapid integration and configuration for developers. It is suitable for IMLib, IMKit, or other RC Android client SDKs that depend on IMLib.
If your application needs to independently integrate third-party vendor push clients or requires the use of push integrator SDKs (such as Getui, JPush, etc.), this integration solution is not applicable. For details, see Resolving Push Client Conflicts.
Integrating Third-Party Push Services
The current RC Push 2.0 integration solution (requires IMLib SDK ≧ 5.6.0) has adapted to Xiaomi, Huawei, Honor, Meizu, OPPO, vivo, and FCM push services. Due to restrictions by domestic smartphone manufacturers, RC's self-built push channel (RongPush) cannot maintain persistence on most domestic device models. You can prioritize integrating third-party push services.
- Integrate Xiaomi Push
- Integrate Huawei Push
- Integrate Honor Push
- Integrate Meizu Push
- Integrate OPPO Push
- Integrate vivo Push
- Integrate FCM Push
Resolving Third-Party Push Client Conflicts
If your application or other SDKs your app depends on have already integrated third-party push clients, you cannot follow the above steps to integrate the RC Push 2.0 SDK, as this will cause conflicts.
After completing the configuration in the RC Console by referring to Integrating Third-Party Push Services, you need to manually report the third-party vendor push service Token to the RC server. For detailed steps, see Resolving Push Client Conflicts.
Integrating RC's Self-Built Push Channel
RC's self-built push channel (RongPush) is a stable and reliable long-connection channel maintained between the RC client SDK and RC's push service. It is the default push capability of the SDK and does not require additional integration of third-party libraries.
After enabling the push feature during SDK initialization, the RC self-built push channel (RongPush) is automatically activated, providing basic push capabilities to the app. Due to restrictions by domestic smartphone manufacturers, RongPush cannot maintain persistence on most domestic device models. It is recommended to simultaneously integrate third-party push channels.
Configure build.gradle.
android {
defaultConfig {
//...
manifestPlaceholders = [
//Enable rongpush. You can disable it if RongPush is not needed
RONG_PUSH_ENABLE : "true"
]
}
}
dependencies {
// x.y.z represents the current IM SDK version number
implementation 'cn.rongcloud.sdk.push:rong:x.y.z'
}
Before initializing the SDK, call the following code to initialize the RongPushPlugin module.
RongPushPlugin.init(getContext());
Since RC's default push channel operates at the application level, it is subject to various system permission restrictions. It is recommended to prompt users to enable the corresponding permissions to improve push delivery rates.