Firebase Cloud Messaging (FCM) and the TUICallKit component, it provides an incoming call display interface with a customizable layout.The display view when the application is in the foreground | The display view when the application is in the background or offline |
![]() | ![]() |
google-services.json file.FCM Platform | Configuring in the Chat console |
![]() | ![]() |
timpush-configs.json file and add the file to the assets directory of the application module, and add the google-services.json to the project app directory.Download the file timpush-configs.json | Download the file google-services.json | Add to the project |
![]() | ![]() | ![]() |
app/build.gradlefile, add the following dependency.implementation "com.tencent.timpush:timpush:latest.release"implementation "com.tencent.timpush:fcm:latest.release"
tuicallkit-kt/build.gradle file.build.gradle file, under buildscript -> dependenciessection, add the following configuration.buildscript {dependencies {classpath 'com.google.gms:google-services:4.3.15'}}
app/build.gradle file, add the following configuration.apply plugin: 'com.google.gms.google-services'
app/proguard-rules.pro file, add TIMPush related classes to the non-aliasing list.-keep class com.tencent.qcloud.** { *; }-keep class com.tencent.timpush.** { *; }
app/build.gradle file, change the application package name to your actual application package name.applicationId 'com.****.callkit'
application class, listener to the TIMPush event and implement automatic login method by your self.import com.tencent.qcloud.tuicore.TUIConstants import com.tencent.qcloud.tuicore.TUICore import com.tencent.qcloud.tuicore.interfaces.ITUINotification class BaseApplication : Application() { override fun onCreate() { super.onCreate() TUICore.registerEvent(TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_KEY, TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_SUB_KEY) { key, subKey, param ->if (TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_KEY == key&& TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_SUB_KEY == subKey) { //you need to login again to launch call activity, please implement this method by yourself autoLogin() } } } }
import com.tencent.qcloud.tuicore.TUIConstants; import com.tencent.qcloud.tuicore.TUICore; import com.tencent.qcloud.tuicore.interfaces.ITUINotification;public class BaseApplication extends Application {@Overridepublic void onCreate() {super.onCreate();TUICore.registerEvent(TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_KEY,TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_SUB_KEY, new ITUINotification() {@Overridepublic void onNotifyEvent(String key, String subKey, Map<String, Object> param) {if (TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_KEY.equals(key)&& TUIConstants.TIMPush.EVENT_IM_LOGIN_AFTER_APP_WAKEUP_SUB_KEY.equals(subKey)) {//you need to login again to launch call activity, please implement this method by yourselfautoLogin();}}});}}
tuicallkit-kt/src/main/res/raw/phone_ringing.mp3 file.
fun requestPermission(context: Context?) {//In TUICallKit,Please open both OverlayWindows and Background pop-ups permission.PermissionRequester.newInstance(PermissionRequester.FLOAT_PERMISSION, PermissionRequester.BG_START_PERMISSION).request()}
Mobile Phone > System Settings > Application Management > Application to manually enable these permissions.Pixel 4a | VIVO |
![]() | ![]() |
info_rtc@tencent.com.Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários