4단계 채팅 사용하기

    4단계 채팅 사용하기


    The content is currently unavailable in Ja - 日本語. You are viewing the default Korean version.
    記事の要約

    채팅 사용 준비

    채팅 사용을 위해 Shoplive 어드민에서 채팅에 접속할 수 있는 사용자 접근 권한을 먼저 설정합니다. 아래의 가이드를 참고해주세요.

    게스트 채팅이 비허용되어 있을 경우, WEB으로부터 수신된 명령어 정보를 활용하여, 로그인 유도를 할 수 있습니다.

    handleReceviedCommand

    Shoplive Flutter SDK의 WEB으로부터 수신된 명령어 정보를 전달합니다.

    receivedCommand.listen((data) { ... })

    Parameter name

    Type

    Description

    command

    String

    명령어 이름

    data

    Map<String, dynamic>

    명령어와 함께 전달되는 데이터

    Sample Code

    _shopLivePlayer.receivedCommand.listen((data) {
      switch (data.command) {
        case "LOGIN_REQUIRED":
          // 로그인 화면으로 이동
          // 로그인이 성공하면, 인증 사용자 계정을 연동하여 샵라이브플레이어를 다시 호출
          _shopLivePlayer.startPictureInPicture();
          // 로그인 화면으로 이동하는 로직
          break;
    
        case "CLICK_PRODUCT_CART":
          // 장바구니 처리 로직
          break;
    
        default:
          break;
      }
    });