鸿蒙 CallKit-v26.8.0
    Preparing search index...

    推送配置提供者

    用于外部向 CallKit 注入推送配置信息,解决 CallKit SDK 不依赖具体配置存储的问题

    26.8.0

    // TestDemo 中实现
    class MyPushConfigProvider implements IRCCallPushConfigProvider {
    getAndroidConfig(isInvite: boolean, pushTitle: string, pushContent: string): AndroidConfig | undefined {
    // 从 Preferences 读取配置
    return androidConfig;
    }
    }

    // 注册
    RCCall.getInstance().setPushConfigProvider(new MyPushConfigProvider());
    interface IRCCallPushConfigProvider {
        getAndroidConfig(
            isInvite: boolean,
            pushTitle: string,
            pushContent: string,
        ): any;
    }
    Index
    • 获取 Android 推送配置

      CallKit 在生成推送配置时会调用此方法,以获取小米模板等特定配置

      Parameters

      • isInvite: boolean

        true: 呼叫邀请场景,false: 挂断场景

      • pushTitle: string

        推送标题(由 CallKit 根据通话类型动态生成)

      • pushContent: string

        推送内容(由 CallKit 根据通话类型动态生成)

      Returns any

      AndroidConfig 或 undefined。如果返回 undefined 或空对象,CallKit 将使用默认配置