If you need to use products such as Chat, CallKit, RoomKit, LiveKit, etc. simultaneously, please refer to IM Quick Integration Solution.
Step 1: Download and add the configuration file
After completing the console manufacturer push information, download and add the configuration file to the project. Add the downloaded timpush-configs.json file to the assets directory of the application module:
1.Choose to download the configuration file timpush-configs.json
2.Add to the project
Step 2: Integrate TIMPush
// The version number "VERSION" can be obtained from the Update Log.
// Integration of the push main package is mandatory
According to vivo and Honor manufacturer's access guidance, it is necessary to add the APPID and APPKEY to the manifest file, otherwise compilation issues will occur.
Method 1
Method 2
android {
...
defaultConfig {
...
manifestPlaceholders =[
"VIVO_APPKEY":"`APPKEY` of the certificate assigned to your application",
"VIVO_APPID":"`APPID` of the certificate assigned to your application",
"HONOR_APPID":"`APPID` of the certificate assigned to your application"
]
}
}
// vivo begin
<meta-data tools:replace="android:value"
android:name="com.vivo.push.api_key"
android:value="`APPKEY` of the certificate assigned to your application"/>
<meta-data tools:replace="android:value"
android:name="com.vivo.push.app_id"
android:value="`APPID` of the certificate assigned to your application"/>
// vivo end
// honor begin
<meta-data tools:replace="android:value"
android:name="com.hihonor.push.app_id"
android:value="`APPID` of the certificate assigned to your application"/>
// honor end
Huawei, HONOR, and Google FCM Adaptation
Follow the vendor method to integrate the corresponding plugin and JSON configuration file.
Note:
The following adaptation for HONOR only requires configuration for version 7.7.5283 and above.
1.1 Download the configuration file and place it under the root directory of the project:
Huawei
HONOR
Google FCM
Operation Path
1.2 Add the following configuration under buildscript -> dependencies in your project-level build.gradle file:
For Gradle version 7.1 and above
Gradle version 7.0
Versions Below Gradle 7.0
Add the following configuration under buildscript -> dependencies in your project-level build.gradle file:
buildscript {
dependencies {
...
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
classpath 'com.hihonor.mcs:asplugin:2.0.1.300'
}
}
In the project-level settings.gradle file, add the following repository configurations under pluginManagement -> repositories and dependencyResolutionManagement -> repositories:
Huawei Push Certificate ID <= 11344, using Huawei Push v2 interface, does not support Reach and Click Receipt, please regenerate and update Certificate ID.
After turning on the receipt toggle, please make sure the receipt address is correctly configured. Not configuring it or configuring the wrong address will affect the push notification feature.
Note:
No configuration for message delivery statistics is required for other supported manufacturers.
FCM currently does not support the push notification statistics feature.
After receiving the push message, clicking the notification bar will trigger the component to callback the click event and pass through the offline message.
1. It is recommended to place the registration callback timing in the onCreate() function of the application.
2. Console configuration follow-up actions are configured as follows, select Open the specified interface within the app and do not modify, use the default values.
The component will notify the application in the form of a callback or broadcast, and the application can configure the app's page jump in the callback.
Note:
1. It is recommended to place the registration callback timing in the onCreate() function of the application.
2. Console configuration follow-up actions are configured as follows, select Open the specified interface within the app and do not modify, use the default values.
Congratulations! You have completed the integration of the push plugin. Please be reminded: After the trial period or subscription expires, the push service (including regular message offline push, all-staff/Tag push, etc.) will automatically cease. To avoid affecting the normal use of your services, please make sure to purchase/renew in advance.