acceptRequest method

Future<ZegoLiveStreamingPKServiceResult> acceptRequest({
  1. required String requestID,
  2. required ZegoLiveStreamingPKUser targetHost,
  3. int timeout = 60,
  4. String customData = '',
})

Accept the PK invitation from the targetHost, which invitation ID is requestID.

If exceeds timeout seconds, the accept will be considered timed out. You can provide your reason by attaching customData.

Implementation

Future<ZegoLiveStreamingPKServiceResult> acceptRequest({
  required String requestID,
  required ZegoLiveStreamingPKUser targetHost,
  int timeout = 60,
  String customData = '',
}) async {
  ZegoLoggerService.logInfo(
    'requestID:$requestID, '
    'targetHost:$targetHost, '
    'timeout:$timeout, '
    'customData:$customData, ',
    tag: 'live-streaming',
    subTag: 'controller.pk, acceptRequest',
  );

  return ZegoUIKitPrebuiltLiveStreamingPK.instance.acceptPKBattleRequest(
    requestID: requestID,
    targetHost: targetHost,
    timeout: timeout,
    customData: customData,
  );
}