enableIncomingBanner method

void enableIncomingBanner(
  1. bool enable
)

Implementation

void enableIncomingBanner(bool enable) {
  CallState.instance.enableIncomingBanner = enable;
  _enableIncomingBanner = enable;
  // 同步通知 Java 侧,确保 WindowManager.showIncomingBanner() 不会提前返回
  NECallKitPlatform.instance.setIncomingBannerEnabled(enable);
  // Android/OHOS 横幅需要悬浮窗权限,开启时自动跳转设置页申请
  if (enable && (Platform.isAndroid || PlatformCompat.isOhos)) {
    NECallKitPlatform.instance.hasFloatPermission().then((hasPermission) {
      if (!hasPermission) {
        CallKitUILog.i(
          _tag,
          'enableIncomingBanner: no float permission, requesting...',
        );
        NECallKitPlatform.instance.requestFloatPermission();
      }
    });
  }
}