API - Common

인증,공통

AccessKey 설정

발급받은 AccessKey를 설정합니다.

ShopLiveCommon.setAdId(adId : String?)

JWT 인증

ShopLiveCommon.setUserJWT(userJWT : String)

ShopLive JWT 인증합니다.

ShopLiveCommon.setUserJWT(jwt : String)

ShopLiveCommon.setUserJWT(accessKey : String, user: ShopLiveCommonUser)

User 정보를 사용하여 JWT token을 만듭니다. 사용자 데이터는 데이터 인사이트에서 확인할 수 있습니다.

ShopLiveCommonUser

fieldtypedescription
userIdString로그인 사용자 아이디 (Required)
nameString?이름
ageInt?나이
genderShopliveCommonUserGender성별
userScoreInt?사용자 등급을 세팅하면 등급에 따른 입장 제한, 이벤트 추첨 제한 등의 기준으로 사용할 수 있습니다.
-100~100까지 설정할 수있습니다.
custom[String: Any]별도로 제공하지 않는 값을 추가 할 수 있습니다.
ShopLiveCommon.setuserJWT(accessKey : String,user : ShopLiveCommonUser) -> String? 

인증 정보 초기화

설정된 인증 정보를 초기화합니다.

ShopLiveCommon.clearAuth()

로그인 확인

JWT로그인을 했는지를 파악합니다.

if ShopLiveCommon.isLoggedIn() {
  // Do something
}

AdId 설정

AdId를 설정하여 통계를 측정합니다.

ShopLiveCommon.setAdId(adId : String?)