---
name: "getAccountInfoSync"
mode: "kit"
versionRequirements:
  - { name: "MiniKit", version: "3.1.0" }
platform:
  - "iOS"
  - "Android"
title: "getAccountInfoSync - 获取小程序账号信息的同步版本, 获取小程序id, 获取小程序版本, 获取小程序版本号, 获取小程序名称, 获取小程序名称"
---

## getAccountInfoSync

> [VERSION] MiniKit >= 3.1.0

> [PLATFORM] iOS, Android

### 描述

获取小程序账号信息

### 参数

无


### 引用对象

##### `interface` MiniProgramAccountInfo

| 属性 | 类型 | 最低版本 | 描述 |
| --- | --- | --- | --- |
| `appId` | `string` | `3.2.0` | 小程序 appId |
| `envVersion` | `string` | `3.2.0` | 小程序版本 develop: 开发版 trail: 体验版 release: 正式版 |
| `version` | `string` | `3.2.0` | 小程序版本号 |
| `appName` | `string` | `3.12.1` | 小程序名称 |
| `appIcon` | `string` | `3.12.1` | 小程序图标 |
| `providerType` | `string` | `3.23.0` | 小程序提供者类型 third: 三方 official: 官方 |


### 示例代码

```tsx
ty.getAccountInfo({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
