Game.getUserProfile
函数式 API
getGameCenterGameProfile也可以通过它使用相同的功能。
功能说明
从 Toss 游戏中心获取个人资料信息。若没有个人资料, statusCode为 'PROFILE_NOT_FOUND'会返回 'PROFILE_NOT_FOUND' 响应。若有个人资料,则会一并提供昵称和个人资料图片 URL。
Toss App 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;
};示例代码
这有帮助吗?