FCM Push Notification Integration
- The FCM push channel is suitable for officially released Android devices overseas (with built-in Google GMS services) and will be enabled in overseas network environments.
- After integration, we recommend testing according to the conditions and steps described in Testing FCM Push Notifications.
RC's server-side has integrated communication components with FCM backend. When the app running on the message recipient's device is killed or suspended in the background, the IM SDK's persistent connection channel will be disconnected. If messages need to be delivered at this time, RC's server will send message requests to the FCM backend, which then delivers the messages to the client application running on the user's device.
Integrating FCM in Android Projects
This section follows Google's recommended setup workflow to describe how to add Firebase to your Android project through the Firebase Console. During this process, you must manually add plugins and configuration files to your project.
To help you get started quickly, the following steps have been simplified. For detailed steps, you can refer to Google Documentation or Firebase Chinese Documentation.
Prerequisites
- Install the latest version of Android Studio or update it to the latest version.
- Ensure your project meets the following requirements:
- (SDK ≧ 5.6.3) Use Android 5.0 (API 21) or higher;
- (SDK < 5.6.3) Use Android 4.4 (API 19) or higher;
- Use Jetpack (AndroidX), which requires the following versions:
com.android.tools.build:gradle 3.2.1or highercompileSdkVersion 28or higher
- Set up a physical device or use an emulator to run your application. Note that the FCM client is part of the [Firebase SDK that depends on Google Play services] and requires Google Play services to be installed on the device or emulator.
- Log in to Firebase using your Google account.
To add Firebase to your application, you need to perform several tasks in both the Firebase Console and your open Android project (e.g., downloading the Firebase configuration file from the console and moving it to your Android project).