Game.getUserProfile
함수형 API
getGameCenterGameProfile로도 같은 기능을 쓸 수 있어요.
기능 설명
토스게임센터 프로필 정보를 가져와요. 프로필이 없으면 statusCode가 'PROFILE_NOT_FOUND'인 응답이 반환돼요. 프로필이 있으면 닉네임과 프로필 이미지 URL이 함께 제공돼요.
토스앱 Android/iOS 5.221.0 이상에서 사용할 수 있어요. 브릿지 응답을 받지 못한 환경에서는 undefined가 반환될 수 있어요.
타입
Game.getUserProfile(): Promise<GameCenterGameProfileResponse | undefined>;Params
없음
Response
type GameCenterGameProfileResponse =
| { statusCode: "PROFILE_NOT_FOUND" }
| {
statusCode: "SUCCESS";
nickname: string;
profileImageUri: string;
};예시 코드
도움이 되었나요?